早教吧 育儿知识 作业答案 考试题库 百科 知识分享

比如1,3,7,12,13,15,19,20,23,24这10个数字中任选6个组合,VBA函数怎么写?Sub排列组合()DimMyArr(8)MyArr(1)=4:MyArr(2)=10:MyArr(3)=13:MyArr(4)=14:MyArr(5)=16:MyArr(6)=19:MyArr(7)=23:MyArr(8)=32ForI1=1To3ForI2=I

题目详情
比如1,3,7,12,13,15,19,20,23,24这10个数字中任选6个组合,VBA函数怎么写?
Sub 排列组合()
Dim MyArr(8)
MyArr(1) = 4:MyArr(2) = 10:MyArr(3) = 13:MyArr(4) = 14:MyArr(5) = 16:MyArr(6) = 19:MyArr(7) = 23:MyArr(8) = 32
For I1 = 1 To 3
For I2 = I1 + 1 To 4
For I3 = I2 + 1 To 5
For I4 = I3 + 1 To 6
For I5 = I4 + 1 To 7
For I6 = I5 + 1 To 8
Debug.Print MyArr(I1),MyArr(I2),MyArr(I3),MyArr(I4),MyArr(I5),MyArr(I6)
Next
Next
Next
Next
Next
Next
End Sub
以上这个是错误的,正确的是怎样的呢?
▼优质解答
答案和解析
135658090-==5498-=-7569-0=7745 89-=4657789790809=548798888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888