【模板】对拍
houmy
·
·
个人记录
#include<iostream>
#include<fstream>
#include<windows.h>
using namespace std;
void genData(){
ofstream dtout("dat.txt");
//Put your data-generating code here
}
int i=1;
int main(){
system("@echo off");
cout<<"Compiling..."<<endl;
system("g++.exe -o 1.exe 1.cpp");
system("g++.exe -o 2.exe 2.cpp");
cout<<"Testing..."<<endl;
while(true){
genData();
system("1.exe < dat.txt > 1.txt");
system("2.exe < dat.txt > 2.txt");
if(system("fc 1.txt 2.txt")){
cout<<"Data #"<<i<<" WA"<<endl;
system("pause");
break;
}else{
cout<<"Data #"<<i<<" AC"<<endl;
}
}
}