当前位置: 高中信息技术 / 单选题
  • 1. (2020·浙江模拟) 数组a中依次存放6个有序数据“23 33 44 55 66 77”。

    Dim a(1 To 10) As Integer

    Dim s As String, n, key As Integer

    a(1) = 23: a(2) = 33: a(3) = 44: a(4) = 55: a(5) = 66: a(6) = 77

    i = 1: j = 6: c = 0: key = 35

    Do While i <= j

        c = c + 1

        m = (i + j) \ 2

        If (j - i + 1) Mod 2 = 0 Then m = m + 1

        If a(m) = key Then Exit Do

        If key < a(m) Then j = m - 1 Else i = m + 1

    Loop

    该程序段运行后,下列各变量的值不正确的是:(    )

    A . i=3 B . j=2 C . c=3 D . m=2

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