vb编程十位评委给歌手打分,要求去掉一个最高分一个最低分.然后再求出选手的平均分
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 01:36:14
vb编程十位评委给歌手打分,要求去掉一个最高分一个最低分.然后再求出选手的平均分
vb编程十位评委给歌手打分,要求去掉一个最高分一个最低分.然后再求出选手的平均分
vb编程十位评委给歌手打分,要求去掉一个最高分一个最低分.然后再求出选手的平均分
Dim arr(1 To 10) As Double
Const N = 10
Private Sub Command1_Click()
Record
Dim temp As Double
For i = 1 To N - 1
For j = 1 To N - 1
If arr(j) > arr(j + 1) Then
t = arr(j): arr(j) = arr(j + 1): arr(j + 1) = t
End If
Next j
Next i
showr
End Sub
Private Sub Form_Load()
For txtcount = 0 To 9
Text1(txtcount).Text = ""
Next
End Sub
Private Sub Record()
For txtcount = 0 To 9
arr(txtcount + 1) = Val(Text1(txtcount).Text)
Next
End Sub
Private Sub sort()
End Sub
Private Sub showr()
For txtcount = 0 To 9
Text1(txtcount).Text = arr(txtcount + 1)
Next
End Sub
还要加入10个输入框数组控件,亲测可行,望采纳~