Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enableDelayedExpansion
- @echo Количество тестов:
- @set wrong_answer=0
- @set success=0
- @set not_found=0
- @set /p num_tests=
- @echo Выход после первой ошибки?(0-Yes, 1-No)
- @set /p bool_tests=
- for /L %%i in (1,1,%num_tests%) do (
- Gen.exe > %%i.input
- JuryAns.exe < %%i.input > %%i.output
- UserAns.exe < %%i.input > %%i.user.output
- fc /A %%i.output %%i.user.output
- echo !ERRORLEVEL!
- if !ERRORLEVEL!==2 (
- set /a not_found+=1
- @echo Файл не найден. Проверьте пути или .exe файлы!
- )
- if !ERRORLEVEL!==1 (
- set /a wrong_answer+=1
- if %bool_tests%==0 goto final
- )
- if !ERRORLEVEL!==0 (
- set /a success+=1
- @del %%i.input
- @del %%i.output
- @del %%i.user.output
- )
- )
- :final
- echo Статистика
- echo Успешных: %success%
- echo Не найден файл: %not_found%
- echo Количество ошибок: %wrong_answer%
- echo Всего: %num_tests%
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement