- @echo off
- set $=!
- setlocal enabledelayedexpansion
- (for /l %%i in (1,1,100) do echo 219%%i17)>%~n0.txt
- set /p var=<%~n0.txt
- set com=
- set bom=
- for /l %%a in (0,1,32) do (
- set "bom=!bom!&set #b%%a!$!str:~-%%a,1!$!=!$!str:~-%%a,1!$!"
- if "!var:~%%a,1!"=="" goto :scok
- set "com=!com!&set #c%%a!$!str:~%%a,1!$!=!$!str:~%%a,1!$!"
- )
- :scok
- set com=!com:~1!
- set bom=!bom:~1!
- set "bom=!bom:*&=!"
-
- for /f %%i in (%~n0.txt) do (set str=%%i
- %com%
- %bom%
- )
- set var=
- set tou=
- for /f "tokens=1,2 delims==" %%a in ('set #c') do (set str=%%a
- if "!str:~2,1!"=="!var!" goto :oktou
- set tou=!tou!%%b
- set var=!str:~2,1!
- )
- :oktou
- set wei=
- set var=
- for /f "tokens=1,2 delims==" %%a in ('set #b') do (set str=%%a
- if "!str:~2,1!"=="!var!" goto :okwei
- set wei=%%b!wei!
- set var=!str:~2,1!
- )
- :okwei
- echo %tou:~,-1% %wei:~1%
- pause
复制代码
[ 本帖最后由 netbenton 于 2009-4-22 18:25 编辑 ] |