Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. @echo off
  2. setlocal enableDelayedExpansion
  3. @echo Количество тестов:
  4. @set wrong_answer=0
  5. @set success=0
  6. @set not_found=0
  7. @set /p num_tests=
  8. @echo Выход после первой ошибки?(0-Yes, 1-No)
  9. @set /p bool_tests=
  10. for /L %%i in (1,1,%num_tests%) do (
  11. Gen.exe > %%i.input
  12. JuryAns.exe < %%i.input > %%i.output
  13. UserAns.exe < %%i.input > %%i.user.output
  14. fc /A %%i.output %%i.user.output
  15. echo !ERRORLEVEL!
  16. if !ERRORLEVEL!==2 (
  17. set /a not_found+=1
  18. @echo Файл не найден. Проверьте пути или .exe файлы!
  19. )
  20. if !ERRORLEVEL!==1 (
  21. set /a wrong_answer+=1
  22. if %bool_tests%==0 goto final
  23. )
  24. if !ERRORLEVEL!==0 (
  25. set /a success+=1
  26. @del %%i.input
  27. @del %%i.output
  28. @del %%i.user.output
  29. )
  30. )
  31.  
  32. :final
  33. echo Статистика
  34. echo Успешных: %success%
  35. echo Не найден файл: %not_found%
  36. echo Количество ошибок: %wrong_answer%
  37. echo Всего: %num_tests%
  38. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement