本帖最后由 apang 于 2013-10-7 18:04 编辑
效率不高。。。- @echo off
- (for /f "tokens=1*delims==" %%i in (a.txt) do (
- setlocal enabledelayedexpansion
- for %%a in (%%j) do set .%%a=1
- for /f "delims==" %%a in ('set .') do (
- set "a=%%a" & set "a=!a:.=1!"
- set /a "1/(a-b-1)"2>nul&&set "s=!s!!b! "||set "s=!s!!b!-"
- set "b=!a!"
- )
- for %%a in (!s!!a!) do (
- set "str=%%a"
- if "!str:-=!" neq "!str!" (
- set /a m=!str:~,3!-100,n=!str:~-3!-100
- set "str=!m!-!n!"
- ) else set /a str-=100
- set "str1=!str1! !str!
- )
- echo,%%i=!str1:~1!,
- endlocal
- ))>b.txt
- pause
复制代码
|