- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type 1.txt') do (
- set "str=%%a"&set "n=0"
- call :count
- )
- echo.&pause&exit
- :count
- set "var=!str:~%n%,1!"
- set /a "n+=1"
- if not "!str:~%n%,1!"=="" (goto :count)
- set /a "m=%n%/2"
- set /a "mm=40-%m%"
- for /l %%c in (1 1 %mm%) do (call set "kong=%%kong%% ")
- echo %kong%%str%
- set "kong="
复制代码
|