rt,生成数据、标准程序、我的程序,需不需要加 freopen
对拍程序如下
#include <cstdlib>
#include <iostream>
int main() {
system("gen.exe > 1.txt");
system("biaozhun.exe < 1.txt > 2.txt");
system("wodechengxu.exe < 1.txt > 3.txt");
const char* command = "fc 2.txt 3.txt > result.txt";
int result = system(command);
if (result == 0) {
std::cout << "Files are the same." << std::endl;
} else {
std::cout << "Files are different." << std::endl;
}
return 0;
}