10个同学参加测试,分数为A,B,C,D,E五个等级,如果A计5分,B计4分,以此类推,求这10个
PrivateSubcommand1_Click()Dimi%,n%,mark$,aver!Fori=1To10mark=InputBox("请输入成绩")SelectC...
Private Sub command1_Click()
Dim i%, n%, mark$, aver!
For i = 1 To 10
mark = InputBox("请输入成绩")
Select Case UCase(mark)
Case "A": n = n + 5
Case "B": n = n + 4
Case "C": n = n + 3
Case "D": n = n + 2
Case "E": n = n + 1
Case Else: n = n + 0
End Select
Next
aver = n / 10
Print "平均为:"; aver
End Sub
不知道为什么平均值一直为零,求解答,求改正
这是个算平均数的题目,大标题写错了 展开
Dim i%, n%, mark$, aver!
For i = 1 To 10
mark = InputBox("请输入成绩")
Select Case UCase(mark)
Case "A": n = n + 5
Case "B": n = n + 4
Case "C": n = n + 3
Case "D": n = n + 2
Case "E": n = n + 1
Case Else: n = n + 0
End Select
Next
aver = n / 10
Print "平均为:"; aver
End Sub
不知道为什么平均值一直为零,求解答,求改正
这是个算平均数的题目,大标题写错了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询