求助NOILinux
  • 板块学术版
  • 楼主expnoi
  • 当前回复5
  • 已保存回复5
  • 发布时间2024/2/27 08:10
  • 上次更新2024/2/27 16:05:48
查看原帖
求助NOILinux
378346
expnoi楼主2024/2/27 08:10

里面的运行出来的可执行文件都没有扩展名。。

对拍代码差不多是这样:

#include <stdio.h>
#include <stdlib.h>

int main() {
  // For Windows
  // 对拍时不开文件输入输出
  // 当然,这段程序也可以改写成批处理的形式
  while (true) {
    system("gen > test.in");  // 数据生成器将生成数据写入输入文件
    system("test1.exe < test.in > a.out");  // 获取程序1输出
    system("test2.exe < test.in > b.out");  // 获取程序2输出
    if (system("fc a.out b.out")) {
      // 该行语句比对输入输出
      // fc返回0时表示输出一致,否则表示有不同处
      system("pause");  // 方便查看不同处
      return 0;
      // 该输入数据已经存放在test.in文件中,可以直接利用进行调试
    }
  }
}

然后运行后说找不到文件。

求助教教NOIlinux怎么对拍。

2024/2/27 08:10
加载中...