笨方法也想了很久很久- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in (a.txt) do (
- for %%j in (%%i) do (
- set /a n+=4
- set "str=%%j !str!")
- set "str1=!str: =!"
- call :lp !str!
- set str=)
- echo.&echo Total: %n%&echo.
-
- for /f "tokens=1,2 delims=.=" %%i in ('set .^|sort /+4 /r') do (
- if %%j gtr 1 (echo %%i = %%j&set str=flag) else (
- if not defined str echo 千字文沒有重字
- pause&exit))
-
- :lp
- if "%1" neq "" echo %1&shift
- set /a ".%str1:~,1%+=1"
- set "str1=%str1:~1%"
- if defined str1 goto lp
复制代码
|