当前位置: 高中信息技术 / 单选题
  • 1. (2021高三上·浙江开学考) 某对分查找的VB程序段如下:

    a(1) = 12

    For i = 2 To 10

        a(i) = a(i - 1) + Int(Rnd * 10) + 1

    Next i

    i = 1: j = 10: c = 0: key = 15

    Do While i <=j

        m = (i + j) \ 2

        c = c + 1

        If a(m) = key Then

            Exit Do

        ElseIf a(m) < key Then

            i = m + 1

        Else

            j = m - 1

        End If

    Loop

    执行该程序段后,变量c的值不可能为(    )

    A . 4 B . 3 C . 2 D . 1

微信扫码预览、分享更方便