vb某学校举行英语演讲比赛,评分规则是8个评委的打分中去掉一个最高分和一个最

2020-07-13 教育 146阅读
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
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com