VB取最大值和最小值写回
Private Sub Command1_Click()
Dim min%, max%, i%, a(1 To 10) As Integer
Randomize
For i = 1 To 10
a(i) = Int(Rnd() * 89) + 10
Next i
min = a(1): max = a(1)
For i = 2 To 10
If a(i) > max Then max = a(i)
If a(i) < min Then min = a(i)
Next i
Text1.Text = max
Text2.Text = min
End Sub