Private Sub Command1_Click()
Dim a(1 To 3) As Integer, k As Integer, t As Integer, s As Integer
a(1) = 12: a(2) = 41: a(3) = 2
s = 0
For k = 2 To 3
If a(k) > a(1) Then
t = a(1): a(1) = a(k): a(k) = t
s = s + 1
End If
Next k
Text1.Text = Str(a(1))
Text2.Text = Str(s)
End Sub