试题 试卷
题型:单选题 题类:真题 难易度:普通
浙江省普通高校招生选考科目信息技术试卷(2019.4)
i = 1 :j = n
Do While i + 1 < j
m = (i + j) \ 2
If a(m + 1) - a(m) > a(m) - a(m - 1) Then
Else
End if
Loop
Label1.Caption="相邻两个元素的最大差值是" + Str(a(j) - a(i))
上述程序段两个方框处的语句分别为( )
i = 1: j = 8: count = 0: f = False
Key = Val(Text1.Text)
Do While i <= j
If a(m) = Key Then
count = count + 1
f = True
End If
If a(m) < Key Then
i = m + 1
j = m - 1
End If Loop
数组元素a(1)到a(8)分别为1,2,3,4,5,6,6,7,在Text1输入6,执行该程序段后,下面说法正确的是( )
Key = Int(Rnd * 49) * 2 + 1
s = 0: i = 1: j = 10
If Key = a(m) Then Exit Do If Key < a(m) Then
j = m - 1: s = 2 * s
i = m + 1: s = 2 * s + 1
数组a(1)到a(10)的值依次为“2,6,7,15,20,24,27,43,52,63”,执行该程序段后,s的值不可能为( )
i = 1: j = 8: s = ""
key =Text1.Text
m =(i + j) \ 2
If key = a(m) Then
s = s + "M"
Exit Do
ElseIf key > a(m) Then
j = m - 1: s = s + "L"
i = m + 1: s = s + "R"
Text1.Text = s
数组元素a(1)到a(8)的值依次为“4,22,27,32,35,44,56,59”,该程序段执行后,文本框Text1中显示的内容不可能是( )
Key=Val(Text1.Text)\10
Text2.Text=“”
i=1: j=9: f=False
Do While i<=j And Not f
m=(i+j)\2
if a(m) Mod 10=Key Then
search=m
f=True
Elseif a(m) Mod 10>Key Then
i=m+1
j=m-1
Text2.Text=Text2.Text+Str(m)
则在执行该程序后,Text2中显示的内容是( )
q=[0]*6
q[0]=1
head=0; tail=1
while tail<len(q)=1:
x=q[head]
if x%2==0:
q[tail]=x//2
tail+=1
else:
q[tail]=x*2
q[tail+1]=x*3
tail+=2
head+=1
程序运行后 , tail-head的值为( )
试题篮