试题七(15分,每空3分)(
阅读以下说明及Visual Basic 程序代码,将应填入___(n)___处的字句写在答题纸的对应栏内。
[说明]
设窗体上有两个文本框和一个按钮,在第一个文本框text1中输入一个全部由“0”和“1”组成的字符串,单击按钮,在第二个文本框text2中显示出给定字符串中连续的0和连续的1中连续字符数目的最大值。如果输入的字符串中有不是“0”和“1”的字符,使用消息框显示错误信息。
运行界面如下:
[程序]
Private Sub Command1_Click()
Dim strSource As String
Dim str1 As String
Dim result As Integer
Dim int1 As Integer, num As Integer
strSource = Text1.Text
If Len(strSource) = 0 Then
MsgBox "请在文本框中输入由0和1组成的字符串"
Exit Sub
End If
For int1 = 1 To Len(strSource)
___(1)___
If str1 <> "1" And str1 <> "0" Then
MsgBox "不能输入非0或非1的字符"
Exit Sub
End If
Next
str1 = ___(2)____
num = 1
For int1 = 2 To Len(strSource)
If str1 = Mid(strSource, int1, 1) Then
___(3)___
Else
If result < num Then
result = num
End If
str1 = Mid(strSource, int1, 1)
___(4)___
End If
Next
If result < num Then
result = num
End If
___(5)___
End Sub



没答案给出来干什么?
怎么没有答案呢,,
不然怎么知道自己做对了没有啊