VB输入N位学生的单门课程成绩并显示,其中人数N,由读入得到:(用控件数组实现,如多个按钮,多个文本框)
1个回答
展开全部
Private Sub Command1_Click(Index As Integer)
Dim i, n, stu(100) As Integer
Select Case Index
stu(Index + 1) = Val(InputBox("请输入成绩", "输入"))
End Select
End Sub
Private Sub sort(s() As Integer, n As Integer)
Dim i, max, temp As Integer
max = s(1)
For i = 1 To n
If max > s(i) Then
temp = s(i)
s(i) = max
max = temp
End If
Next
End Sub
Dim i, n, stu(100) As Integer
Select Case Index
stu(Index + 1) = Val(InputBox("请输入成绩", "输入"))
End Select
End Sub
Private Sub sort(s() As Integer, n As Integer)
Dim i, max, temp As Integer
max = s(1)
For i = 1 To n
If max > s(i) Then
temp = s(i)
s(i) = max
max = temp
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询