不一样的电脑,不一样的梦想
  • 板块学术版
  • 楼主ass_wecan
  • 当前回复7
  • 已保存回复7
  • 发布时间2022/10/29 10:48
  • 上次更新2023/10/27 05:14:24
查看原帖
不一样的电脑,不一样的梦想
505805
ass_wecan楼主2022/10/29 10:48

知道我天我才了解到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;
}


所以这是世界的参差吗

2022/10/29 10:48
加载中...