- @echo off
- title abc
- :0
- set /p hh=请输入两位数
- echo %hh%|findstr "^[0-9][0-9]">tmp.tmp
- for /f %%i in (tmp.tmp) do ( if %%i == %hh% echo 格式正确
-
- &goto 1)
- echo 输入格式错误
- pause
- del /q tmp.tmp
- goto 0
- :1
- echo %hh%
- set ss1=%hh:~0,1%
- set ss2=%hh:~1,1%
- set /a ss=ss1+ss2
- echo %ss%
- goto 0
- pause>nul
复制代码
|