复制代码
- @echo off
- echo 错题本>错题本.txt
- :start
- cls
- echo 输入1,则代表一位数的加减乘除
- echo 最多输入4
- set str=+-*/
- set/p e=
- if "%e%"=="1" (goto yi)
- if "%e%"=="2" (goto er)
- if "%e%"=="3" (goto san)
- if "%e%"=="4" (goto si) else echo 请输入1、2、3、4&pause&cls&goto start
- :yi
- cls
- echo 输入go则返回至开始
- echo 输入end则结束
- echo 输入see则查看记录
- set/a f=%random%%%9+1
- set/a g=%random%%%9+1
- setlocal enabledelayedexpansion
- set /a n=%random%%%4
- set a=!str:~%n%,1!
- set/a h=%f%%a%%g%
- echo %f%%a%%g%=请输入正确答案
- set/p b=
- if %b%==go goto start
- if %b%==end goto end
- if %b%==see goto see
- if %b%==%h% (
- echo 输入正确&echo %f%%a%%g%=%h%你输的是%b%。。输入正确>>错题本.txt
- ) else echo 输入错误&echo 正确答案是%h%&echo %f%%a%%g%=%h%你输的是%b%。。输入错误>>错题本.txt
- pause
- goto yi
- :see
- type "错题本.txt"
- pause
- goto yi
- :er
- cls
- echo 输入go则返回至开始
- echo 输入end则结束
- echo 输入see则查看记录
- set/a f=%random%%%99+10
- set/a g=%random%%%99+10
- setlocal enabledelayedexpansion
- set /a n=%random%%%4
- set a=!str:~%n%,1!
- set/a h=%f%%a%%g%
- echo %f%%a%%g%=请输入正确答案
- set/p b=
- if %b%==go goto start
- if %b%==end goto end
- if %b%==%h% (
- echo 输入正确&echo %f%%a%%g%=%h%你输的是%b%。。输入正确>>错题本.txt
- ) else echo 输入错误&echo 正确答案是%h%&echo %f%%a%%g%=%h%你输的是%b%。。输入错误>>错题本.txt
- pause
- goto er
- :see
- type "错题本.txt"
- pause
- goto er
- :san
- cls
- echo 输入go则返回至开始
- echo 输入end则结束
- echo 输入see则查看记录
- set/a f=%random%%%999+100
- set/a g=%random%%%999+100
- setlocal enabledelayedexpansion
- set /a n=%random%%%4
- set a=!str:~%n%,1!
- set/a h=%f%%a%%g%
- echo %f%%a%%g%=请输入正确答案
- set/p b=
- if %b%==go goto start
- if %b%==end goto end
- if %b%==%h% (
- echo 输入正确&echo %f%%a%%g%=%h%你输的是%b%。。输入正确>>错题本.txt
- ) else echo 输入错误&echo 正确答案是%h%&echo %f%%a%%g%=%h%你输的是%b%。。输入错误>>错题本.txt
- pause
- goto san
- :see
- type "错题本.txt"
- pause
- goto san
- :si
- cls
- echo 输入go则返回至开始
- echo 输入end则结束
- echo 输入see则查看记录
- set/a f=%random%%%9999+1000
- set/a g=%random%%%9999+1000
- setlocal enabledelayedexpansion
- set /a n=%random%%%4
- set a=!str:~%n%,1!
- set/a h=%f%%a%%g%
- echo %f%%a%%g%=请输入正确答案
- set/p b=
- if %b%==go goto start
- if %b%==end goto end
- if %b%==%h% (
- echo 输入正确&echo %f%%a%%g%=%h%你输的是%b%。。输入正确>>错题本.txt
- ) else echo 输入错误&echo 正确答案是%h%&echo %f%%a%%g%=%h%你输的是%b%。。输入错误>>错题本.txt
- pause
- goto si
- :see
- type "错题本.txt"
- pause
- goto si
- :end
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |