输入数据: A组:2,8,9 B组:4,7,9,10 C组:8,11,12 条件: 1,一组只能选一个号 2,选出的号不能相同 3,A组
用VB编写的代码如下
view plaincopy to clipboardprint?
Option Base 1
Private Sub Command1_Click()
Dim a()
Dim b()
Dim c()
a = Array(2, 8, 9)
b = Array(4, 7, 9, 10)
c = Array(8, 11, 12)
For i = 1 To UBound(a)
For j = 1 To UBound(b)
If a(i) < b(j) Then
For k = 1 To UBound(c)
If b(j) < c(k) Then
Print a(i), b(j), c(k)
End If
Next k
End If
Next j
Next i
End Sub
责任编辑:小草