- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in (a.txt) do (
- set "str= %%i "
- set "str=!str: you = 临时 !"
- set "str=!str: me = you !"
- if "!str:~0,5!"==" you " set "str= You !str:~5!"
- set "str=!str: 临时 = me !"
- set num=!str:~1,-1!
- set /a n=0,m+=1
- set "var!m!=!num!"
- call :loop "!num!"
- if !n! gtr !h! set /a h=n
- )
- set /a n=h/2+1,h=n*2
- for /l %%i in (1 1 %n%) do set u=─!u!&set "l= !l!"
- echo ┌!u!┐
- for /l %%i in (1 1 %m%) do (
- if %%i neq 1 echo ├!u!┤
- set "c=!var%%i!!l!"
- echo │!c:~0,%h%!│
- )
- echo └!u!┘
- pause
- exit
-
- :loop
- if defined num (set /a n+=1) else goto :eof
- set num=!num:~1!
- goto loop
复制代码
|