试题 试卷
题型:单选题 题类:常考题 难易度:容易
浙江省义乌市群星外国语学校2017届高三上学期期中考试信息技术试题
i = 1: j = 7: x = 55
Do While i <= j
m = (i + j) \ 2
If a(m) = x Then Exit Do
If a(m) > x Then j = m - 1 Else i = m + 1
Loop
经过上述代码查找后,下列表达式正确的是( )
Dim a(1 To 10) As Integer
a(1) = 1: a(2) = 2
For i = 3 To 10
a(i) = a(i - 1) + a(i - 2)
Next i
i = 1: j = 10: f = False
Do While i <= j And f = False
num = num + 1
If num = a(m) Then
f = True
ElseIf num < a(m) Then
j = m - 1
Else
i = m + 1
End If
Text1.Text = Text1.Text + Str(m)
该程序段执行结束后,文本框Text1中显示的内容是( )
i=1:j=7:x=“high”
Do While i <=j
m=(i+j)\2
If a(m)=x Then Exit Do
If a(m) > x Then
j=m-1
i=m+1
执行完上述代码后,根据最终变量值判断下列表达式,其中成立的是( )
i=1: j=5: k=0: s=""
key=Int(Rnd*100)
k=k+1
m=(i+j) \ 2
s=s+Str(a(i))
If key=a(m) Then
Exit Do ‘Exit Do表示退出循环
ElseIf key < a(m) Then
Text1.Text=s
数组元素a(1)到a(5)的值依次为“6,18,25,37,49”。若该程序段执行后,k的值为3,则key的值不可能为( )
试题篮