一个排列组合的问题,已经有初步思路:基本模型如下:
| | | | | @echo off | | set ".1=a" | | set ".2=b" | | set ".3=c" | | set n=3 | | set "prefix=<title>" | | set "suffix=</title>" | | cd /d "C:\Documents and Settings\Administrator\桌面\新建文件夹" | | for /f "delims=" %%a in ('dir /a-d/b *.html') do ( | | set file=%%a | | setlocal enabledelayedexpansion | | set /a n=!random!%%n+1 | | ( | | for %%a in (!n!) do echo;!prefix!!.%%a!!suffix! | | more "!file!" | | ) > "%temp%\~tmp" | | move "%temp%\~tmp" "!file!" | | endlocal | | ) | | pauseCOPY |
现在运行系列只能生成
<title>a</title>
<title>b</title>
<title>c</title>
我本意是生成这样的p33的排列组合结果里面任意取3个即可
<title>abc</title>
<title>ab</title>
<title>ac</title>
<title>bc</title>
<title>bc</title>
这样的
明白我意思了吗? |