@echo off set "str=13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 2 3 4 5 6 7 8 9 10 11 12" :again for /f "tokens=1,2,4*" %%a in ("%str%") do ( if not "%%c"=="" (set "str=%%c %%d %%a %%b"&goto :again) else (echo %%b&pause&exit) )
ieutk:
复制代码 代码如下:
@echo off setlocal enabledelayedexpansion for /l %%a in (12 -1 1) do set "str= %%a !str!" for /l %%a in (29 -1 13) do set "str= %%a !str!"
:main set "ie=0" for %%a in (%str%) do set /a ie+=1 if %ie% neq 1 ( for %%a in (%str%) do ( set /a num+=1 if !num! equ 3 ( set "num=0" set "str=!str: %%a =! ) ) goto main ) echo %str% pause
batman:
复制代码 代码如下:
@echo off&setlocal enabledelayedexpansion for /l %%a in (13,1,29) do set "str=!str! #%%a#" for /l %%a in (1,1,12) do set "str=!str! #%%a#" :lp for %%a in (!str!) do ( set /a n+=1 if !n! equ 3 set "str=!str: %%a=!"&set /a n=0 ) for /f "tokens=2" %%a in ("%str%") do if "%%a" neq "" goto lp echo 最后剩下的是%str:#=%号&pause>nul