哈哈,2楼的思路快多了,只用了10分钟。
:- @echo off&setlocal enabledelayedexpansion
- echo 正在排列,请耐心等候。。。
- echo\&echo 开始时间 %time%
- set t=%time%
- for /l %%i in (123456 1 654321) do (
- for /l %%a in (1 1 6) do set "%%a="
- set flag=&set var=%%i
- set num=!var:~0,1! !var:~1,1! !var:~2,1! !var:~3,1! !var:~4,1! !var:~5,1!
- for /l %%a in (1 1 6) do set var=!var:%%a=!
- if not defined var (
- for %%a in (!num!) do (
- if not defined %%a (set %%a=a) else set flag=a
- )
- if not defined flag (
- set num=!num:4=a!
- set num=!num:5=b!
- set num=!num:6=c!
- echo !num!
- set /a n+=1
- title 第 !n! 个组合
- )))
- echo 共有 !n!个组合
- echo 结束时间 %time%
- pause
复制代码
|