当前位置: 高中信息技术 / 单选题
  • 1. (2020·浙江模拟) 某查找算法的VB程序段如下:

    Dim a(1 To 10) As Integer

    Randomize

    Key = Int(Rnd * 32)* 3 + 3

    a(1)= 4:a(2)= 7:a(3)= 9:a(4)= 15:a(5)= 24

    a(6) = 32:a(7) = 37: a(8)= 54: a(9) = 75: a(10) = 90

    s=0:i = 1:j = 10

    Do While i <= j

      m =(i + j)\ 2

      If Key = a(m) Then Exit Do

      If Key > a(m) Then

        i = m + 1:s = 3 * s + 2

      Else

        j = m - 1:s = 3 * s

      End If

    Loop

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

    A . 78 B . 60 C . 24 D . 20

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