对拍
#include <bits/stdc++.h>
using namespace std;
int check(int i)
{
cout<<"check:"<<i<<endl;
system("./rand>rand.in");
system("./a<rand.in>a.out");
system("./b<rand.in>b.out");
//linux
int res=system("diff a.out b.out>nul");
//windows
//int res=system("fc a.out b.out>nul");
return res;
}
int main()
{
int x;
cin>>x;
for(int i=1;i<=x;i++)
{
if(!check(i))
{
continue;
}
else
{
cout<<"wa in:"<<i<<endl;
system("pause");
break;
}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int check(string a, string b)
{
string cmd1="./a < " + a + " > ans.out";
string cmd2="diff " + b + " ans.out > nul";
system(cmd1.c_str());
int res = system(cmd2.c_str());
return res;//测试大样例
}
int main()
{
string a, b;
cin >> a >> b;
if (!check(a, b))
{
cout << "AC";
}
else
{
cout << "WA";
}
return 0;
}1.脑洞学生会
6.12月哈利波特
9.轮回漫画
10.暑假剪辑六花茴香