C++对拍程序简单写法 大佬们的博客 Some Links

运行这个对拍程序的前提是数据生成器,暴力,正解都是用文件输入输出,且输入输出文件需要对应

windows系统下C++对拍程序

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main(){
    while(1){
        system("gen");
        system("bf");
        system("right");
        if(system("fc bf.out right.out"))break;
    }
    return 0;
}

linux下系统对拍程序

#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
    while(1){
        system("./gen");
        system("./bf");
        system("./right");
        if(system("diff bf.out right.out")){
            printf("WA\n");
            break;
        }
        else printf("AC\n");
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/ylsoi/article/details/79824655
今日推荐