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

    Dim a(1 To 10) As Integer

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

    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

    数组a(1)到a(10)的值依次为“4,7,9,15,24,32,37,54,75,90”,执行该程序段后,s的值不可能为(  )

    A . 20 B . 80 C . 62 D . 18

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