题型:单选题 题类:模拟题 难易度:困难
浙江省普通高校招生信息技术选考模拟卷(二)
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) + "步
试题篮