这是我在某个巨佬的博客里复制的对拍代码:
#include<cstdio>
#include<cstdlib>
#include<ctime>
int main()
{ long s,t;
while(1){
system("cls");
do{
system("data > try.in"); //data是数据生成程序
s=clock();
system("a < try.in > try1.out"); //a是要交的程序
t=clock();
system("b < try.in > try2.out"); //b是正确的程序
if(system("fc try1.out try2.out > nul"))
break;
else printf("AC time: %ldms\n",t-s);
}while(1);
printf("WA time: %ldms\n",t-s); //运行时间
system("fc try1.out try2.out");
system("pause>nul");
}
return 0;
}
这一个对拍程序只能在两个程序输出的东西不同时输出输出数据。
而本人想要在两个程序输出的东西不同时输出输入数据。
所以这个功能该怎么实现呢?
不要回复bdfs,我查过了,每个博主写的对拍都是这个样子的