订正5楼代码》改为纯P的“递归”结构应该就可以了...
- @echo off
- setlocal enabledelayedexpansion
- set "pwd=b654bc321"
- :[Loop]
- set "_pwd=!pwd!"
- set "pwd_=!pwd!"
- for %%n in (0,1,2,3,4,5,6,7,8,9) do set "_pwd=!_pwd:%%n=,!"
- echo,!_pwd!
- for %%s in (!_pwd!) do set "pwd=!pwd:%%s=!"
- if "!pwd!"=="!pwd_!" (goto[end]) else (goto[Loop])
- :[end]
- echo,!pwd!
- endlocal&exit/b
复制代码
|