早教吧作业答案频道 -->其他-->
比如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...的网友还看了以下:
matlab简单程序编写求助!a=[-0.5:0.1:0.5];y=(exp(0.3*a)-exp 2020-05-12 …
下面给出的四个命题中,假命题是A.如果a=3,那么|a|=3B.如果x2=4,那么x=±2C.如果 2020-05-17 …
1.已知X^2-10X+Y+8Y+41=0,求X和Y.2.已知|M-2|+N^2+6N+9=0,求 2020-06-11 …
一道简单的高一数学题!刚学!晕!已知函数f(x)=3x-1开立方/ax^2+ax-3的定义域为R, 2020-07-04 …
(答得好加分)1.已知X^2+y^2-2x+4y+5=0,求x、y的值2.已知a^2+b^2=5, 2020-07-18 …
已知A(-3,0)B(0,-4),P为双曲线y=12/x(x>0)上的任意一点,过点P作⊥y轴与点 2020-07-26 …
二次型的化标准型的问题!设XTAX=x1^2+4*x2^2+x3^2+2aX1X2+2bX1X3+ 2020-07-31 …
是真命题的是(1)b/a+a/b≥2成立当且仅当a,b均为正数.(2)y=2x^2+3/x,(x> 2020-08-01 …
(a^2-b^2-c^2)tanA+(a^2-b^2+c^2)tanB=0(a^2-b^2-c^2 2020-08-02 …
为什么matlab出现TherearemoreODEsthanvariables.inits='a( 2020-10-30 …