试题

试题 试卷

logo

题型:单选题 题类:常考题 难易度:普通

浙江省温州新力量联盟2019-2020学年高二下学期信息技术期中联考试卷

有两个以字母结尾的字符串s1和s2,在不区分大小写的前提下判断它们是否相同。该功能的VB程序段如下:

Private Sub Command1_Click(  )

Dim c1 As String, c2 As String, s1 As String, s2 As String

s1 = Text1.Text: s2 = Text2.Text

i = 1: j = 1

Do While i <= Len(s1) And j <= Len(s2)

    c1 = Mid(s1, i, 1): c2 = Mid(s2, j, 1)

    If                        Then

        i = i + 1: j = j + 1

    Else

        Exit Do          'Exit Do表示退出循环

    End If

Loop

If i > Len(s1) And j > Len(s2) Then T3.Text = "相同" Else T3.Text = "不相同"

End Sub

Function toLowerCase(x As String) As String   '该函数把大写字母转成小写

    If x >= "A" And x <= "Z" Then

        toLowerCase = Chr(Asc(x) + 32)

    Else

                             

    End If

End Function

划线处的代码从以下代码中选择,每条划线一句代码:

①toLowerCase = Chr(Asc(x) - 32)     ②toLowerCase = x

③toLowerCase(c1) = toLowerCase(c2)   ④c1 = c2

选择代码组合正确的是

A、④ ① B、① ④ C、③ ① D、③ ②
返回首页

试题篮