题型:综合题 题类:模拟题 难易度:普通
浙江省2019年信息技术选考模拟试卷三
Private Sub Command1_Click()
Dim s As String
Dim n As Integer , i As Integer
s = Text1.Text
n=Len(s) : i=1 : result=""
Do While i<=n
s1=Mid(s, i, 1)
numbers=0
‘扫描到的字符都和s1相同
Do While
i=i+1
numbers = numbers+ 1
Loop
If numbers>0 Then
result= result & &s1
i = i+1
End If
start =1
s1 = Mid(s,i,1)
numbers =0
'扫描到的字符都和s1不同
Do While s1<>Mid(s,i+1,1)
i=i+1
numbers = numbers+ 1
s1=Mid(s,i,1)
Loop
If Mid ( s , i + 1 , 1 ) = s1 Then
numbers = numbers-1
End If
If numbers >= 0 Then
result = result&"1" &&"1"
End If
Loop
Text2.Text=result
End Sub
试题篮