‘//俺是這樣:(僅取出一段,代碼不規(guī)范)
dim arrBB(7) ‘//臨時(shí)數(shù)組
dim arrCC(3000,7) ‘//有效組合--保存結(jié)果
strAA="1,2,3,4,5,6,7,8,9,10,11,12" ‘// 12是變數(shù)--存入所選號(hào)碼
arrAA=split(atrAA,",")
ilow= LBound(arrAA)
ihigh= UBound(arrAA)
response.write "<center>"&"你選的是:"
for i=ilow to ihigh
response.write arrAA(i)&" "
next
response.write "<br>"
r1=1
r2=1
for q1=1 to ihigh+1
r1=r1*q1
next
for q1=1 to ihigh+1-7
r2=r2*q1
next
if r2=0 then r2=1
r3=r1/r2/5040
response.write ihigh+1&"個(gè)數(shù)字按7個(gè)一組共有: "&r3&" 個(gè)組合.<br>"
j=1
For i1 = ilow To ihigh-6
For i2=i1+1 to ihigh-5
For i3=i2+1 to ihigh-4
For i4=i3+1 to ihigh-3
For i5=i4+1 to ihigh-2
For i6=i5+1 to ihigh-1
For i7=i6+1 to ihigh
‘//得到數(shù)組
arrBB(1)=arrAA(i1)
arrBB(2)=arrAA(i2)
arrBB(3)=arrAA(i3)
arrBB(4)=arrAA(i4)
arrBB(5)=arrAA(i5)
arrBB(6)=arrAA(i6)
arrBB(7)=arrAA(i7)
‘//過濾
iglz=guolv(arrBB,j) ‘//調(diào)用縮水
if iglz=1 then
response.write j&": "&arrBB(1)&" "&arrBB(2)&" "&arrBB(3)&" "&arrBB(4)&" "&arrBB(5)&" "&arrBB(6)&" "&arrBB(7)&"<br>"
‘//存入數(shù)組--做旋轉(zhuǎn)縮水用
for imn=1 to 7
arrCC(j,imn)=arrBB(imn)
next
j=j+1
end if
next
next
next
next
next
next
next
function guolv(bb,kj)
‘//旋轉(zhuǎn)過濾--把已有的去掉,中7保X
ibao=5 ‘//保5
gl_tmp=1
IF kj >= 2 then
for nn1=1 to kj-1 ‘//對有效期比較
isum=0
for nn2=1 to 7
IF arrCC(nn1,nn2)-bb(nn2)=0 then isum=isum+1
Next
IF isum-ibao>=0 then
gl_tmp=0
guolv = gl_tmp
Exit function
end if
Next
End IF
‘//旋轉(zhuǎn)過濾....END............................
guolv = gl_tmp
end function
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。