c++对拍实现

直接上代码吧.

#include<bits/stdc++.h>
using namespace std;

int main(){
    while(1){
    system("./cute_data");//生成数据程序
    system("./cute_ans");
    system("./cute");//暴力与正解程序
    if(system("diff cute.out cute_ans.out")){//检测到两个文件不同返回1
        printf("Fail\n");
        break;
    }
    else printf("Pass\n");
    }
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/BCOI/p/9000157.html