vb某学校举行英语演讲比赛,评分规则是8个评委的打分中去掉一个最高分和一个最
3个回答
展开全部
Private Sub Command1_Click()
Dim i As Integer
Dim min As Double
Dim max As Double
Dim s As Double
Dim sum As Double
min = 100
For i = 1 To 8
s = Val(InputBox("请输入成绩"))
If max < s Then
max = s
End If
If min > s Then
min = s
End If
sum = sum + s
Next
Print "去掉一个最高分" & max & ",去掉一个最低分" & min
Print "总分为" & sum - max - min & ",平均分为" & (sum - max - min) / 6
End Sub
Dim i As Integer
Dim min As Double
Dim max As Double
Dim s As Double
Dim sum As Double
min = 100
For i = 1 To 8
s = Val(InputBox("请输入成绩"))
If max < s Then
max = s
End If
If min > s Then
min = s
End If
sum = sum + s
Next
Print "去掉一个最高分" & max & ",去掉一个最低分" & min
Print "总分为" & sum - max - min & ",平均分为" & (sum - max - min) / 6
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询