当前位置: 高中信息技术 / 单选题
  • 1. (2020高二上·诸暨期末) 有如下 VB 程序段:

    Dim a(1 To 10) As Integer

    a(1) = 20: a(2) = 19: a(3) = 17: a(4) = 15: a(5) = 15

    a(6) = 15: a(7) = 16: a(8) = 20: a(9) = 25: a(10) = 27

    L = 1: R = 10

    Do While L <= R

        m = (L + R) \ 2

        If a(m) > a(m - 1) Then

            R = m - 1

        Else

            L = m + 1

        End If

    Loop

    Text1.Text = Str(R)

    该程序段运行后,文本框Text1中显示的内容是(  )

    A . 4 B . 5 C . 6 D . 7

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