vb歌手大赛评分程序10位评委除去一个最高分和一个最低分计算平均数(设满分为10)
PrivateSubForm_Click()DimmaxAsSingleminAsSingle,sAsSingle,pAsSingle,xAsSingleDimiAsIn...
Private Sub Form_Click()
Dim max As Single min As Single, s As Single, p As Single, x As Single
Dim i As Integer
Mas=0
Min=0
For I =1 To 10
x=Val(InputBox("请输入分数"))把接下来的步骤补全! 展开
Dim max As Single min As Single, s As Single, p As Single, x As Single
Dim i As Integer
Mas=0
Min=0
For I =1 To 10
x=Val(InputBox("请输入分数"))把接下来的步骤补全! 展开
展开全部
Dim Sc(10) As Single
Dim max As Single, min As Single, s As Single, p As Single, x As Single
Dim i As Integer
s = 0
Sc(1) = Val(InputBox("请输入第1个评委的分数!"))
Do While Sc(1) < 0 Or Sc(1) > 10
Sc(1) = Val(InputBox("请输入第1个评委的分数!", "输入错误!请重新输入!"))
Loop
max = Sc(1)
min = Sc(1)
s = s + Sc(1)
For i = 2 To 10
Sc(i) = Val(InputBox("请输入第" & i & "个评委的分数!"))
Do While Sc(i) < 0 Or Sc(i) > 10
Sc(i) = Val(InputBox("请输入第" & i & "个评委的分数!", "输入错误!请重新输入!"))
Loop
s = s + Sc(i)
If Sc(i) > max Then max = Sc(i)
If Sc(i) < min Then min = Sc(i)
Next i
s = s - max - min
p = s / 8
Print "评委给分:"
Print "序号:";
For i = 1 To 10
Print Left(CStr(i) & " ", 4);
Next i
Print
Print "得分:";
For i = 1 To 10
Print Left(CStr(Sc(i)) & " ", 4);
Next i
Print
Print "平均分:"; p
Dim max As Single, min As Single, s As Single, p As Single, x As Single
Dim i As Integer
s = 0
Sc(1) = Val(InputBox("请输入第1个评委的分数!"))
Do While Sc(1) < 0 Or Sc(1) > 10
Sc(1) = Val(InputBox("请输入第1个评委的分数!", "输入错误!请重新输入!"))
Loop
max = Sc(1)
min = Sc(1)
s = s + Sc(1)
For i = 2 To 10
Sc(i) = Val(InputBox("请输入第" & i & "个评委的分数!"))
Do While Sc(i) < 0 Or Sc(i) > 10
Sc(i) = Val(InputBox("请输入第" & i & "个评委的分数!", "输入错误!请重新输入!"))
Loop
s = s + Sc(i)
If Sc(i) > max Then max = Sc(i)
If Sc(i) < min Then min = Sc(i)
Next i
s = s - max - min
p = s / 8
Print "评委给分:"
Print "序号:";
For i = 1 To 10
Print Left(CStr(i) & " ", 4);
Next i
Print "得分:";
For i = 1 To 10
Print Left(CStr(Sc(i)) & " ", 4);
Next i
Print "平均分:"; p
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询