VB 号码组合

来源:百度知道 编辑:UC知道 时间:2024/06/18 13:56:34
想用VB写一个号码组合软件,请高手指教...

输入数据:
A组:2,8,9
B组:4,7,9,10
C组:8,11,12

条件:
1,一组只能选一个号
2,A组 <B组 <C组

想要列出所有结果:
2,4,8
2,4,11
2,4,12
2,7,8
2,7,11
2,7,12
2,9,11
2,9,12
2,10,11
2,10,12
8,9,11
8,9,12
8,10,11
8,10,12
9,10,11
9,10,12

请问要怎么写,,,,,有控件吗?

Private Sub Form_Click()
Dim a(), b(), c()
Cls
Me.AutoRedraw = True
a = Array(2, 8, 9)
b = Array(4, 7, 9, 10)
c = Array(8, 11, 12)
For i = LBound(a) To UBound(a)
For j = LBound(b) To UBound(b)
For k = LBound(c) To UBound(c)
If a(i) < b(j) And b(j) < c(k) Then
Print a(i), b(j), c(k)
End If
Next
Next
Next
End Sub