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个输入框数组控件,亲测可行,望采纳~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询