Option Base 1
Private Sub Command1_Click()
Cls
Dim a As Integer
Dim b As Integer
b = Int(Val(Me.Text1.Text))
Dim hello() As Integer
ReDim hello(b)
a = LBound(hello)
While a <= UBound(hello)
hello(a) = Int(Rnd * 1000)
a = a + 1
Wend
Dim t As Integer
m = LBound(hello)
While m <= UBound(hello) - 1
a = LBound(hello)
While a <= UBound(hello) - m
If hello(a) < hello(a + 1) Then
t = hello(a)
hello(a) = hello(a + 1)
hello(a + 1) = t
End If
a = a + 1
Wend
m = m + 1
Wend
a = LBound(hello)
While a <= UBound(hello)
Print hello(a)
a = a + 1
Wend
End Sub
Private Sub Command1_Click()
Cls
Dim a As Integer
Dim b As Integer
b = Int(Val(Me.Text1.Text))
Dim hello() As Integer
ReDim hello(b)
a = LBound(hello)
While a <= UBound(hello)
hello(a) = Int(Rnd * 1000)
a = a + 1
Wend
Dim t As Integer
m = LBound(hello)
While m <= UBound(hello) - 1
a = LBound(hello)
While a <= UBound(hello) - m
If hello(a) < hello(a + 1) Then
t = hello(a)
hello(a) = hello(a + 1)
hello(a + 1) = t
End If
a = a + 1
Wend
m = m + 1
Wend
a = LBound(hello)
While a <= UBound(hello)
Print hello(a)
a = a + 1
Wend
End Sub