您的当前位置:首页求组合

求组合

2022-02-13 来源:爱问旅游网
按下ALT+F11,插入-模块,复制下面代码到代码框中,按下F5运行程序“Order”, 这样A1:A220就是12个数字的组合。

Sub Order()

Dim Num(11) As Integer

Dim a As Integer, b As Integer, c As Integer Num(0) = 4 Num(1) = 6 Num(2) = 7 Num(3) = 8 Num(4) = 11 Num(5) = 45 Num(6) = 16 Num(7) = 18 Num(8) = 19 Num(9) = 22 Num(10) = 35 Num(11) = 48

Range(\"a1\").Select For a = 0 To 11

For b = 0 To 11 For c = 0 To 11

If a > b And b > c Then

ActiveCell.Value = Num(a) & \Num(c)

ActiveCell.Offset(1, 0).Select End If Next Next Next End Sub

因篇幅问题不能全部显示,请点此查看更多更全内容