Private Sub Form_Activate()
Dim a(1 To 20) As Integer, b As Integer, c As Integer, d As Integer, e As Integer
Randomize
Print "随机数:";
For i = 1 To 20
a(i) = Int(Rnd * 50) + 50
If a(i) > d Then d = a(i)
e = e + a(i)
Print a(i);
Next
c = a(1)
For i = 2 To 20
If c > a(i) Then c = a(i)
Next
Print
Print "最小值为:"; c
Print "最大数为:"; d
Print "平均值为:"; e / i
End Sub