make:生成数据的代码
test:暴力代码,一定是正确的
code:写的代码
windows:
g++ make.cpp -o make
g++ test.cpp -o test
g++ code.cpp -o code
pause
:loop
make.exe > in.txt
test.exe < in.txt > outt.txt
code.exe < in.txt > out.txt
fc outt.txt out.txt
if not errorlevel 1 goto loop
pause
goto loop
Linux:
使用需要添加权限
chmod +x duipai.sh
#!/bin/bash
g++ make.cpp -o make
g++ test.cpp -o test
g++ code.cpp -o code
read -p "compile finished"
while true; do
./make > in
./test < in > ans
./code < in > out
if diff ans out; then
printf "AC\n"
elif diff -B -b ans out; then
printf "PE\n"
exit 0
else
printf "WA\n"
exit 0
fi
done