...不能有重复的,有多少组,能不能用EXCEL表把明细列出来
发布网友
发布时间:2024-10-22 20:17
我来回答
共2个回答
热心网友
时间:2024-10-22 21:17
需用宏来穷举列出,三步走:
1.alt+F11
2.双击左边工程框里的Sheet1,右边的编辑窗口中输入以下代码:
Sub sa()
Dim i, j, k, l, n, o, m, p, q As Integer
q = 0
For i = 1 To 9
For j = i + 1 To 10
For k = j + 1 To 11
For l = k + 1 To 12
For m = l + 1 To 13
For n = m + 1 To 14
For o = n + 1 To 15
For p = o + 1 To 16
q = q + 1
Cells(q, 1).Value = i
Cells(q, 2).Value = j
Cells(q, 3).Value = k
Cells(q, 4).Value = l
Cells(q, 5).Value = m
Cells(q, 6).Value = n
Cells(q, 7).Value = o
Cells(q, 8).Value = p
Next
Next
Next
Next
Next
Next
Next
Next
End Sub
3.F5
热心网友
时间:2024-10-22 21:15
16!/(8!*8!)=16*15*14*13*12*11*10*9/(1*2*3*4*5*6*7*8)=12870