关于 Linux 环境下的对拍
  • 板块学术版
  • 楼主rainygame
  • 当前回复7
  • 已保存回复7
  • 发布时间2023/10/20 21:16
  • 上次更新2023/11/2 12:24:33
查看原帖
关于 Linux 环境下的对拍
804607
rainygame楼主2023/10/20 21:16

怎么写呀?要求不需要 freopen 就可以做到,Windows 下代码如下:

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

int cnt(0);

signed main(){
    cin.tie(0);
    cout.tie(0);

    while (true){
        system("gen.exe > data.in");
        system("right.exe < data.in > data.ans");
        system("wrong.exe < data.in > data.out");
        if (system("fc data.ans data.out /W")) break;
        cout << "times:" <<(++cnt) << '\n';
    }

    return 0;
}

如果可以的话,希望增加判断时间和空间,以及过滤文件末回车和行末空格。

当然需要 C++ 版本的对拍。

2023/10/20 21:16
加载中...