题型:综合题 题类:模拟题 难易度:普通
浙江省普通高校招生信息技术选考模拟卷(四)
414243 |
ABC |
758927 |
不合法 |
小明编写了一个压缩的VB程序,功能如下:在文本框Text1中输入需压缩数据(偶数个字符),单击“压缩”按钮Command1,程序对压缩数据依次进行压缩处理,压缩数据显示在文本框Text2中。程序运行界面如图所示:
Private Sub Command1_Click()
Dim s1 As String, s2 As String, c1 As String,c2 As String
Dim i As Integer, k As Integer
s1 = Text1.Text
For i = 1 To len(s1) step 2
c1 = Mid(s1, i, 1)
c2=
If c1 >= 8 Then
s2 = "不合法":Exit for
Else
k =
s2 = s2 + Chr(k)
End If
Next i
Text2.Text = s2
End Sub
试题篮