Примеры скриптов. Уберите пробелы внутри "% %"!
echo off for % %f in (??) do echo TEST % %f & copy % %f sum.in > nul & ..\a.exe & check.exe sum.in sum.out % %f.a
echo off for % %f in (??) do echo TEST % %f & copy % %f sum.in > nul & ..\a.exe & fc /w % %f.a sum.out & if errorlevel 1 exit
echo off for ~% %f in (??) do echo TEST % %f & copy % %f sum.in > nul & ..\a.exe & check.exe sum.in sum.out % %f.a & if errorlevel 2 exit
Пример чекера:
#include <iostream> #include <fstream> using namespace std; int main(int narg, char ** argv) { if (narg != 4) { cerr << "You must specify 3 args" << endl; return 1; } ifstream input(argv[1]); ifstream output(argv[2]); ifstream correct(argv[3]); int user_ans, correct_ans; output >> user_ans; correct >> correct_ans; if (user_ans == correct_ans) { cout << "OK" << endl; return 0; } else { cout << "WA" << endl; return 2; } }