实现上述功能的VB程序如下,请在划线处填入合适的代码。
Private Sub
Command 1_Click( )
Dim sp As String, s As String s ‘s存储甲选手多局比赛的记录数据, 长度小于50
Dim a(1 To 50)As
Integer, e(1 To 20)As Integer
Dim i
As Integer, j As Integer, k As Integer, n As Integer, m As Integer
Dim f1
As Integer, f2 As Integer
s=Text 1.Text
n=Len(s)
For i=2 To n
a(i)=Val()
Next i
m=0 : i=1
Do While i<=n
k=i
Do While a(i)=0 And i<=n 找出疑似错误位置
i=i+1
Loop
If Then
m=m+1:e(m)=i-1
End If
i=i+1
Loop
For i=1 To m ‘对每个疑似错误位置分别修改数据,并统计每局比分
f1=0 : f2=0
k=e(1)
a(k)=1
sp="" & k &""
For j=1 To n
If a(j)=1 Then f1=f1+1 Else f2=f2+1
If Then
sp=sp & "/" & f1 &":" & f2
f1=0 : f2=0
End If
Next j
If f1+f2>0 Then sp=sp & "" & f1 & ":"& f2
List 1.AddItem sp
Next i
End Sub