实现上述功能的部分VB程序如下,请在划线处填入合适的代码。
Dim n As Integer
Dim a(1 To 100) As String
Dim b(1 To 100) As Integer
Dim c(1 To 100) As Integer
Dim fg(1 To 100) As Boolean
Private Sub Form_Load()
'读取n个参会者提交的信息,依次存入a(1)~a(n)
'将a(1)~a (n)按参会者到达时间排序,并在List1中显示,代码略
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As String
Dim sum As Integer, q As Integer
For i=1 To n
b(i) = T(Mid(a(i), 1, 5))
c(i) = b(i) + Int Mid(a(i), 7, 1))
For j=1 To 2 Step-1
k=
If c(k) > c(j) Then
q=b(k):b(k)=b(j):b(j)=q
q=c(k):c(k)=c(j):c(j)=q
Else
Exit For
End If
Next j
Next i
sum=0
For i=1 To n
If fg(i) = False Then
For j=1 To n
If Then
fg(j) = True
End If
Next j
End If
Next i
Text1.Text = str (sum)
End Sub
Function T(str1 As String) As Integer
T = Int(Mid(str1,1, 2)) * 60 + Int(Mid(str1, 4, 2))
End Function