在命令窗口里执行下面的代码,参考着改一下。
Dim arys() As Integer = {9, 1, 2,3, 0, 4, 4, 5, 5, 6, 7, 8}
Array.sort(arys)
Dim prev As Integer = -999
Dim ls1 As New List(Of Integer)
Dim ls2 As New List(Of Integer)
For Each ary As Integer In arys
If prev = ary AndAlso ls1.Contains(ary) = False Then
ls1.Add(ary)
ls2.Remove(ary)
End If
If ls1.Contains(ary) = False Then
ls2.Add(ary)
prev = ary
End If
Next
For Each l As Integer In ls1
output.Show(l)
Next
For Each l As Integer In ls2
output.Show(l)
Next