如何用VB实现数组合排序并删除重复数?
首先将下面五组数分别对应输入据第一组(08 10 16 25 28 33 )第二组(12 13 19 22 28 29 )第三组(01 07 08 20 23 24 )第四组(01 04 20 24 28 29 )第五组(12 20 25 26 27 28 )。然后点击计算按钮后,对这五组数据实现数组合排序并删除重复数。并将结果输入结果文本框。
--------------------编程问答--------------------
--------------------编程问答--------------------
Sub main()
Dim a(4), b(1 To 33), msg As String
a(0) = Array(8, 10, 16, 25, 28, 33)
a(1) = Array(12, 13, 19, 22, 28, 29)
a(2) = Array(1, 7, 8, 20, 23, 24)
a(3) = Array(1, 4, 20, 24, 28, 29)
a(4) = Array(12, 20, 25, 26, 27, 28)
For i = 0 To 4
For j = 0 To UBound(a(i))
b(a(i)(j)) = 1
Next j, i
For i = 1 To 33
If b(i) Then msg = msg & i & " "
Next
MsgBox msg
End Sub
--------------------编程问答--------------------
怎么看着像是易做图选号方式呢?
--------------------编程问答--------------------
Sub main()
Dim a(4), b(1 To 33), msg As String
a(0) = Array(8, 10, 16, 25, 28, 33)
a(1) = Array(12, 13, 19, 22, 28, 29)
a(2) = Array(1, 7, 8, 20, 23, 24)
a(3) = Array(1, 4, 20, 24, 28, 29)
a(4) = Array(12, 20, 25, 26, 27, 28)
For i = 0 To 4
For j = 0 To UBound(a(i))
b(a(i)(j)) =a(i)(j) & " "
Next j, i
msg =join(b,vbnullstring)
MsgBox msg
End Sub
补充:VB , 基础类