生成数据ios
#include <cstdio> #include <iostream> #include <ctime> #include <windows.h> using namespace std; int main() { srand(time(0)); int a, b; a = rand()%100 + 1; b = rand()%100 + 1; printf("%d %d",a,b); return 0; }
对拍windows
#include <cstdio> #include <iostream> #include <windows.h> using namespace std; int main() { int t = 10; while(--t) { system("data.exe > data.txt"); system("a+b.exe < data.txt > a+b.txt"); system("baoli.exe < data.txt > baoli.txt"); if(system("fc a+b.txt baoli.txt")) break; } if(t != 0) printf("error\n"); else printf("no error\n"); return 0; }
过样例后必定要造数据,
用小数据找错误,大数据看边界。
而后对拍。大数据
话说,只会打暴力的我为何要对拍
但愿不久以后个人对拍能派上用场。spa