本帖最后由 battab 于 2014-2-18 22:51 编辑
回复 1# yslyxqysl - @echo off
- :r
- set "input="
- set /p input=请输入要入理的数字串:
- echo %input%|findstr "^[0-9][0-9]*$">nul||(echo 包含非数字)&&goto r
- set str=%input%
- :l
- if "%str:~0,1%"=="0" (set str=%str:~1%) else (goto end)
- goto l
-
- :end
- echo %str%
- pause>nul
- echo 继续请按r,退出请按任意键。
- set "enter="
- set /p enter=请输入:
- if "%enter%"=="r" goto r else exit
复制代码
|