Private Sub Command1_Click()
Dim i As Integer
Dim sum, scores(50) As Double
sum = 0
For i = 1 To 50
scores(i) = InputBox("输入第" & i & "数字:", "提示")
If scores(i) > 100 Or scores(i) < 0 Then
MsgBox "成绩必须在0到100之间!"
scores(i) = InputBox("输入第" & i & "数字:", "提示")
Else
sum = sum + scores(i)
End If
Next i
Text1.Text = Format(sum, "0.00")
Text2.Text = Format(sum * 1# / 50, "0.00")
End Sub