第2个回答 2013-07-09
Private Sub Command1_Click()
Dim a(9)
Sum = 0
Randomize
For i = 0 To 9
a(i) = Int(Rnd * 100) + 1
Print a(i);
Sum = Sum + a(i)
Next i
Min = a(0)
Max = a(0)
For i = 1 To 9
If a(i) < Min Then
Min = a(i)
End If
If a(i) > Max Then
Max = a(i)
End If
Next i
Print
Print "最大值" & Max
Print "最小值" & Min
Print "和" & Sum
print "平均值" & sum/10
End Sub