题目

某对分查找算法的VB程序段如下: key = Val(Text 1.Text) i = 1: j = 10 Text2.Text ="" Do While i<=j   m = Int((i+j)/2 + 0.5)   If key = a(m)Then Exit Do     'Exit Do 表示退出循环   If key < a(m)Then j=m-1 Else i = m + 1   Text2.Text =Text2.Text + Str(a(m)) Loop 数组元素a(1)到a(10)的值依次为“8,17,24,30,36,40,55,58,61,66”,文本框 Textl中输入的值是30,执行该程序段,文本框Text2中显示的是 (  ) A . 40 24 B . 40 24 36 C . 36 24 D . 36 17 24 答案:B
信息技术 试题推荐
最近更新