|
发表于 2015-2-17 06:40:29
|
显示全部楼层
本帖最后由 netegg 于 2015-2-17 06:49 编辑
[au3]#include <Array.au3>
#include <String.au3>
Global $ret = ''
Global $str = '12345'
$aA = StringSplit($str, '', 2)
$aA1 = StringSplit(StringTrimLeft($str, 1), '', 2)
$aA2 = StringSplit(StringTrimLeft($str, 2), '', 2)
$aA3 = StringSplit(StringTrimLeft($str, 3), '', 2)
$aA4 = StringSplit(StringTrimLeft($str, 4), '', 2)
For $i= 1 To 5
$ret &= $i & ','
For $j= $i+1 To 5
$ret &= $i & $j & ','
For $w = $j+1 To 5
$ret &= $i & $j & $w & ','
For $m = $w+1 To 5
$ret &= $i & $j & $w & $m & ','
For $n = $m+1 To 5
$ret &= $i & $j & $w & $m & $n & ','
Next
Next
Next
Next
Next
$aRet = StringSplit(StringTrimRight($ret, 1), ',', 2)
$ret = ''
$ret1 = ''
$ret2 = ''
For $w In $aRet
$w = StringFormat('%06s', $w)
$ret &= $w & ','
next
$aRet1 = StringSplit(StringTrimRight($ret, 1), ',', 2)
_Arraysort($aRet1)
Dim $str[5]= ['a','l','o','s','m']
Dim $aNumer
For $v In $aRet1
$v = Number($v)
If StringLen($v) >1 Then
$ret2 = ''
$aNumber = StringSplit($v, '',2)
For $u In $aNumber
$ret2 &= $str[$u-1]
next
Else
$ret2 = $str[$v-1]
endif
$ret1 &= $ret2 & ','
next
$aRet2 = StringSplit(StringTrimRight($ret1, 1), ',', 2)
_arraydisplay($aRet2)
[/au3]不知道对不对,到底有没有顺序问题,这个不包含重复值,比如aa,aal。。。。之类的 |
|