从10个数字中,遍历,求6个数组的组合
展开全部
Dim a()
Dim temp As String = ","
Dim n As Integer
Dim i, j, k, t, y, u As Integer
a = Split("1,2,3,4,5,6,7,8,9,10", temp)
n = UBound(a)
Dim cou As Integer = 0
If Trim(a(UBound(a))) = "" Then n = UBound(a) - 1
TextBox6.Text = ""
For i = 0 To n - 5
For j = i + 1 To n - 4
For k = j + 1 To n - 3
For t = k + 1 To n - 2
For y = t + 1 To n - 1
For u = y + 1 To n
TextBox6.Text = TextBox6.Text & a(i) & " " & a(j) & " " & a(k) & " " & a(t) & " " & a(y) & " " & a(u) & vbCrLf
cou += 1
Next u
Next y
Next t
Next k
Next j
Next i
MsgBox(cou)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询