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

    a(1) = 2: a(2) = 2: a(3) = 5: a(4) = 6: a(5) = 7

    Key = 2

    i = 1: j = 5: flag = False Do While i <= j And Not flag

    m = (i + j) \ 2 If Key = a(m) Then

    s = "找到第" + Str(m) + "个" flag = True: Exit Do

    ElseIf Key < a(m) Then j = m - 1

    Else

    i = m + 1 End If

    s = Str(m) + s Loop Label1.Caption = s

    执行该程序段后,在标签 Label1 中显示的内容是(   )

    A . 1  3 B . 3  1 C . 找到第 1 个 D . 找到第 2 个

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