key=Val(Text1.Text)
s=“ ”
i = 1 : j = 10
Do While i <= j
m =(i+j)\2
s = s+ Str(a(m))
If a(m)> key Then j = m -1 Else i = m +1
Loop
Text2.Text = s
数组元素a(1)到a(10)的值依次为“2,3,5,8,9,10,13,17,19,20”。在文本框Text1中输入待查找的数,执行该程序段,则文本框text2中显示的内容可能的是 ( )
微信扫码预览、分享更方便