Private Sub Command1_Click()
msg$ = "请输入分数(-1结束)"
msgtitle$ = "输入数据"
start:
score = InputBox(msg$, msgtitle$)
score = Val(score)
If score < 0 Or score > 100 Then
GoTo finish
Else
total = total + score
n = n + 1
If score < 60 Then
n1 = n1 + 1
Else
n2 = n2 + 1
End If
End If
GoTo start
finish:
End Sub
Private Sub Command2_Click()
Text1.Text = Str$(n2)
Text2.Text = Str$(n1)
Text3.Text = Str$(total / n)
End Sub
Private Sub Command3_Click()
n = 0: n1 0: n2 = 0: total = 0
End
End Sub
Private Sub Form_Load()
Dim n As Single
Dim n1 As Single
Dim n2 As Single
Dim score As Single
Dim totol As Single
End Sub