我帮你写好了:
Dim A(1000) As Double, Rs As Long
Private Sub Command1_Click()
A(Rs) = Val(Text1.Text)
Rs = Rs + 1
Label2.Caption = "总人数有:" & Rs
End Sub
Private Sub Command2_Click()
Dim L As Integer, B As Double, C As Double, D As Double, E As Double, F As Double
B = 0
For L = 0 To Rs '取出最大值
If B < A(L) Then B = A(L)
Next
C = 100
For L = 0 To Rs '取出最小值
If C > A(L) Then C = A(L)
Next
For L = 0 To Rs '将所有数相加
D = D + A(L)
Next
For L = 0 To Rs '不及格人数统计
If A(L) < 60 Then E = E + 1
Next
F = Rs - E
D = D / Rs '算出平均值
Label2.Caption = "总人数有:" & Rs & "平均分:" & Round(D, 2) & "最高分:" & B & "最低分" & C & "及格人数:" & F & "不及格人数:" & E
'MsgBox "平均分保留小数2位:" & Round(D, 2)
End Sub