组卷题库 > 高中信息技术试卷库
试题详情
为防止机密通知被盗,某公司制定了网上发通知的加密要求:

⑴通知中包含的空格,标点符号等按原格式输出

⑵通知中涉及到字母的内容,所发文件的英语单词全部都是倒序的。如:This is a dog!通知显示内容为: sihT si a god!

⑶通知中涉及到数字的内容, 把本组数字的最后一位移动到第一位,例如原文为 1234,通知显示内容为:4123

小王编写了一个VB程序,实现加密功能,在文本框 Text1中输入原文,单击“加密”按钮Command1 后,在文本框Text2中显示加密后的密文。程序运行界面如图所示。

实现上述功能的VB程序如下,请回答下列问题:

Private Sub command1_Click()

    Dim s As String, ch As String, rv As String, rv1 As String

    Dim i As Integer, j As Integer, k As Integer

    s = Text1.Text

    rv = ""

    i = 1

    Do While True

        ch = Mid(s, i, 1)

        Do While  __________ And i <= Len(s)

            rv = rv + ch

            i = i + 1

            ch = Mid(s, i, 1)

    Loop

    j = i

    ch =   ①  

    Do While sz(ch) And j <= Len(s)

        j = j + 1

        If j > Len(s) Then Exit Do

        ch = Mid(s, j, 1)

    Loop

    rv1 = ""

    rv1 = Mid(s, j - 1, 1) + Mid(s, i, j - i - 1)

    rv = rv + rv1

    i =   ②  

    If i > Len(s) Then Exit Do

    Do While zf(ch) And j <= Len(s)

        j = j + 1

        If j > Len(s) Then Exit Do

        ch = Mid(s, j, 1)

    Loop

    rv1 = ""

    For k = i - 1 To j - 1

        rv1 = Mid(s, k, 1) + rv1

    Next k

    rv = rv + rv1

    If j <= Len(s) Then rv = rv + Mid(s, j, 1)

        i = j + 1

        If i > Len(s) Then Exit Do

    Loop

    Text2.Text = rv

End Sub

Function zf(s As String) As Boolean

    zf = False

    If s >= "A" And s <= "Z" Or s >= "a" And s <= "z" Then

        zf = True

    End If

End Function

Function sz(s As String) As Boolean

    sz = False

    If   ③  Then

        sz = True

    End If

End Function

知识点
参考答案
采纳过本试题的试卷
教育网站链接