Heiro7 > 15-06-12, 07:22 AM
Private Sub Cmdxep_hang_Click()
Dim a(9) As Integer
Dim b(9) As Integer
Dim i, j As Integer
a(1) = 9
a(2) = 8
a(3) = 8
a(4) = 7
a(5) = 5
a(6) = 4
a(7) = 4
a(8) = 3
a(9) = 2
For i = 1 To 9
List1.AddItem a(i)
Next i
b(1) = 1
For i = 2 To 9
If a(i) = a(1) Then
b(i) = 1
Else
If a(i) <> a(i - 1) Then
b(i) = i
j = i
Else
b(i) = j
End If
End If
Next i
For i = 1 To 9
List1.AddItem b(i)
Next i
End Sub