@echo off setlocal EnableDelayedExpansion title 迷你背单词 Made by 公孙轩辕 QQ:327828994 color f1 set /a b=0,c=0 for /f "tokens=*" %%i in (word.txt) do (set/a hang+=1) for /l %%i in (1,1,8) do echo/ echo 当前单词总数为%hang%个 ping/n 2 127.1>nul&cls :b set /a n=%random%%%!hang!+1 for /f "skip=%n% tokens=1,2 delims= " %%i in (word.txt) do (set word=%%i&set content=%%j&call :a&goto :b) :a echo/&echo/ echo 当前测试结果:对!c!个,错!b!个&for /l %%i in (1,1,10) do echo/ set/p=%content%: <nul set/p a= if "%a%"=="cx" goto :c if "%a%"=="%word%" cls&set/p=回答正确,<nul&set/p=答案:%word% %content%<nul&set/a c+=1&echo/&goto :eof cls&set/p=回答错误,答案:%word% %content%<nul&echo/&set/a b+=1&echo %word% %content%>>error.txt&goto :eof