我本人的解,还是很繁琐,思路跟浅默的差不多。望更多人参与此题,求得更多的解!
-
- @echo off&setlocal enabledelayedexpansion
- set length=0
- for /f "tokens=1,2" %%a in (1.txt) do (
- set x=0
- call :lp %%a%%b
- if !x! gtr !length! set length=!x!
- )
- set/a length+=4
- for /f "tokens=1,2,*" %%a in (1.txt) do (
- set x=0
- set/p=%%a <nul
- call :lp %%a%%b
- set/a s=length-x
- for /l %%i in (1 1 !s!) do set/p= <nul
- set/p=%%b<nul
- set/p= %%c<nul
- echo.
- )
- pause&exit/b
- :lp
- set str=%1
- :lp1
- if defined str set str=!str:~1!&set/a x+=1&goto lp1
复制代码
|