首先,感叹一下楼主的语言输出能力!
代码如下:- @echo off&setlocal enabledelayedexpansion
- set /p str=请输入:
- echo 字符串.号前各字母轮流替换成26个字母:>a.txt
- echo 字符串.号前各字母后轮流加一次26个字母:>b.txt
- set "code=a b c d e f g h i j k l m n o p q r s t u v w x y z"
- for /l %%a in (0,1,12) do (
- set /a a=%%a+1
- if not defined flag (
- if %%a equ 0 (
- for %%b in (%code%) do (
- echo %%b%str:~1%>>a.txt
- echo %str:~,1%%%b%str:~1%>>b.txt
- )
- ) else (
- for %%b in (%code%) do (
- for %%c in (!a!) do (
- echo !str:~,%%a!%%b!str:~%%c!>>a.txt
- echo !str:~,%%c!%%b!str:~%%c!>>b.txt
- )
- )
-
- )
- )
- for %%c in (!a!) do if "!str:~%%c,1!" equ "." set "flag=a"
- )
- copy /y a.txt+b.txt a.txt&del /q b.txt
- start a.txt
复制代码
[ 本帖最后由 batman 于 2011-3-9 11:22 编辑 ] |