知道我天我才了解到system是有返回值的
然后我就跟机房的神仙学了学
system在fc的时候如果匹配了返回的是 1
就如同去年T1的对拍代码:
#include<bits/stdc++.h>
using namespace std;
signed main(){
system("g++ -o airport.exe airport.cpp");
system("g++ -o blairport.exe blairport.cpp");
system("g++ -o data1.exe data1.cpp");
int T=1000,Case=0;
while(T--){
system("data1.exe");
system("airport.exe");
system("blairport.exe");
if(system("fc airport.out blairport.out")) cout<<"Case "<<++Case<<" AC\n";
}
return 0;
}
然后我今天重新在自己电脑上写了,返回值就变成 0 了
长这样:
#include<bits/stdc++.h>
#define printlf(x) print(x),putchar('\n')
#define printsp(x) print(x),putchar(' ')
using namespace std;
signed main(){
system("g++ aplusb.cpp -o aplusb -std=c++14");
system("g++ -o bplusa bplusa.cpp -std=c++11");
system("g++ datamaker.cpp -o datamaker.exe");
int Case=0,T=100;
while(T--){
system("datamaker");
system("aplusb");
system("bplusa");
if(system("fc aplusb.out bplusa.out")==0)
cerr<<++Case<<": AC\n";
else cerr<<"WA on "<<++Case<<endl,system("pause");
}
return 0;
}
所以这是世界的参差吗