'未作测试应该差不多
Private Sub Form_Activate()
Dim arr(1 To 8) As Integer, i As Integer, s, min As Integer, n As Integer, sum As Integer
For i = 1 To 8
s = InputBox("输入分数:", "第" & i & "分数")
If IsNumeric(s) Then
arr(i) = Val(s)
If i = 1 Then
min = arr(i)
Else
If min > arr(i) Then min = arr(i)
End If
Else
i = i - 1
End If
Next
For i = 1 To 8
sum = sum + arr(i)
If arr(i) = min Then n = n + 1
Next
If n = 8 Then
MsgBox "8个分数相同"
Exit Sub
End If
If n = 1 Then
MsgBox "平均分:" & Format((sum - min) / 7, "0.00") '一个最低分
Else
MsgBox "平均分:" & Format((sum - (n - 1) * min) / (9 - n), "0.00") '多个最低分,只留一个
End If
End Sub