题型:单选题 题类:常考题 难易度:困难
浙江省诸暨市牌头中学2018届高三上学期信息技术期中考试试题
key = Val(Text1.Text)
i = 0: j = 9: s = 0
Do While i <= j
m = Fix((i + j) \ 2 + 0.5)
s = s + 1
If key = a(m) Then
Label1.Caption = Label1.Caption + "→" + Str(m)
Exit Do 'Exit Do表示退出循环
End If
If key <a(m) Then j = m - 1 Else i = m + 1
Label1.Caption = Label1.Caption + "→" + Str(m)
Loop
Label2.Caption = "历经" + CStr(s) + "步"
i= 1 : j =9 : n =0
key=Val( Textl.Text)
Do While i <= j
m=(i + j) \ 2
If key = d(m) Then
Exit Do
j= m - 1
Else
i=m+1
End If
Loop
方框中的正确代码应为( )
试题篮