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\n",t);
        }
        else
        {
            printf("%d    :WA\n",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\n",t);
        }
        else
        {
            printf("%d    :WA\n",t);
            break;
        }
    }
    return 0;
}

 

posted @ 2017-07-04 17:08  zzzzx  阅读(412)  评论(0编辑  收藏  举报