- @echo off
- setlocal enableDelayedExpansion
- set /a A=%random%%%5*9
- set /a B=(%random%%%3+1)*3
- set fuhao="+-*/"
- :calc
- set/a n+=1
- set/a RS=%A%!fuhao:~%n%,1!%B%
- echo %A% !fuhao:~%n%,1! %B% = %RS%
- if %n%==4 goto exit
- if not "!fuhao:~%n%,1!"=="" goto :calc
- pause>nul
- goto :eof
- :exit
- pause
复制代码 这题算是10吗,比之前的for处理容易多了 = = |