Private Sub Command1_Click() Dim intA(0 To 49) As Integer Dim i As Integer Dim j As Integer Dim s As Integer Dim Flag As Boolean Dim Temp As Integer Randomize For i = 0 To 49 intA(i) = Int(100 * Rnd) + 1 s = s + intA(i) Next For i = 0 To 49 Flag = False For j = 0 To 48 If intA(j) intA(j + 1) Then Temp = intA(j) intA(j) = intA(j + 1) intA(j + 1) = Temp Flag = True End If Next If Flag = False Then Exit For Next MsgBox 最小值: & intA(0) & ,最大值: & intA(49) & ,平均值: & s / 50 & 。 End Sub