c++ —— .bat 对拍

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<ctime>
using namespace std;


int main()
{
    for(int t = 1;;t ++)
    {
        system("data.exe");
        system("a.exe");
        system("std.exe");
        if(!system("fc a.txt std.txt"))
        {
            printf("%d    :AC
",t);
        }
        else
        {
            printf("%d    :WA
",t);
            break;
        }
    }
    return 0;
}
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<ctime>
using namespace std;


int main()
{
    for(int t = 1;;t ++)
    {
        system("data.exe > in.txt");
        system("a.exe < in.txt > out.txt");
        system("std.exe < in.txt > ans.txt");
        if(!system("fc out.txt ans.txt"))
        {
            printf("%d    :AC
",t);
        }
        else
        {
            printf("%d    :WA
",t);
            break;
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/sssy/p/7117538.html