- @echo off
- setlocal enabledelayedexpansion
- for /l %%i in (1,1,20) do (
- set starstr=!starstr!*
- set spacestr= !spacestr!
- )
-
- set spacelen=20
- set starlen=1
- :STARTLOOP
- if !starlen! GTR 10 goto LOOPEND
- echo !spacestr:~1,%spacelen%! !starstr:~0,%starlen%!
- set /a spacelen=!spacelen!-2
- set /a starlen=!starlen!+1
- goto STARTLOOP
- :LOOPEND
- set spacelen=9
- set starlen=10
- :STARTLOOP2
- if !starlen! LSS 1 goto LOOPEND2
- echo !spacestr:~1,%spacelen%! !starstr:~0,%starlen%!
- set /a spacelen=!spacelen!-1
- set /a starlen=!starlen!-1
- goto STARTLOOP2
- :LOOPEND2
复制代码
|