早教吧作业答案频道 -->其他-->
比如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
以上这个是错误的,正确的是怎样的呢?
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
看了比如1,3,7,12,13,1...的网友还看了以下:
口算2.4+0.73=3.08×4=537-99=2.6×0.3=3-0.71-0.19=8-0. 2020-04-07 …
Excel求两条函数公式第一条:A、B、C列偶数与偶数相加、奇数与奇数相加的和,分别在E、F列显示 2020-04-09 …
已知k∈R,设f(θ)=cos2θ+(k-4)sinθ+2k-9,其中θ∈[0,2π).(1)当k 2020-04-12 …
里约奥运会上,中国女排在与东道主巴西的决胜局中0比2落后,在最危急的时刻,女排姑娘变换打法,积极配 2020-05-17 …
探究匀变速直线运动实验中,使用打点计时器得到一条只带,其中0,1,2,3,4,5.为所选的计数点, 2020-06-03 …
设摆线的参数方程为x=a(t−sint)y=a(1−cost)其中0≤t≤2π,常数a>0.设该摆 2020-06-15 …
根据“19×28=532”写出下面各题的积.1.9×28=1.9×2.8=1.9×0.28=1.9 2020-07-19 …
0.25×12.5×3.27.9×25+31×2.59999×2222+3333×33340.25 2020-07-24 …
把-800°改写成α+2kπ(k∈z)的形式,其中0≤α<2π.并指出α象限 2020-07-26 …
“交通指数”是反映道路网畅通或拥堵的概念性指数值.交通指数的取值范围为0至10,分为5个等级:其中 2020-08-01 …