试题 试卷
题型:单选题 题类:模拟题 难易度:普通
浙江省金华十校2020届高三上学期信息技术11月模拟考试试卷
i=1: j=8: n=1
k=Val(Text1. Text)
Do While i<=j
m=(i+j)2
IF k<d(m) Then j=m-1 Else i=m+1
n=n+1
Loop
数组元素d(1)到d(8)依次为3,9,14,17,25,29,32,35,在文本框 Text1输人“14”。执行程序后,下列说法不正确的是( )
Const n =10
For i = 1 To n - 1
t = n - (n + i ) Mod 2
For j = t To i + 2 Step -2
If d(j)> d(j - 2) Then
Temp=d(j)
d(j) = d(j - 2)
d(j - 2) = temp
End If
Next j
Next i
已知数组元素d(1)到d(10)的原始数据为1、2、3、4、5、6、7、8、9、10.程序运行后,d(10)的值为( )
c = 1: s = 10
Do While c <= s
For i = s To c + 1 Step -1 If Then
t = a(i - 1): a(i - 1) = a(i): a(i) = t End If
Next i For i=
If Then
t = a(i + 1): a(i + 1) = a(i): a(i) = t End If
c = c + 1 s = s - 1
上述程序段三个方框处的语句分别为( )
m = (1 + n) \ 2 ‘n为数组元素的个数,m为数组中间位置元素的下标
For i = 1 To n
If a(i) < a(m) Then t = a(i): a(i) = a(m): a(m) = t
p = m: q = m
For i = 1 To n - 2
If i Mod 2 = 1 Then
k = q + 1: q = q + 1
Else
k = p - 1: p = p - 1
pos = k
For j = 1 To n
If And a(j) < a(k) Then k = j
If pos > k Then
t = a(pos): a(pos) = a(k): a(k) = t
上述程序段方框处的代码为( )
n=8: flag=True: k=0
First=1: Last =n
Do While flag
p= False: flag= False
For j=Last To First +1 Step-1
k=k+1
If a(j)< a(j-1) 1) Then
t=a(j): a(j)=a(j-1): a(j-1)=t
First=j: flag =True
If p= False Then Last=j: p=True
If Last <> n Then Last =Last +1
数组元素a(1)到a(8)值依次为“2,8,12,17,13,14,18,19”,程序运行后,变量k的值为( )
a = [ 6 , 12 , 9 , 20 , 8 , 11 , 4 ]
for j in range( 1 , len( a ) ) :
if a[ j ] < a[ j - 1 ] :
a[ j ] = a[ j ] + a[ j - 1 ] ; a[ j - 1 ] = a[ j ] - a[ j - 1 ] ; a[ j ] = a[ j ] - a[ j - 1 ]
执行该段程序后,列表a的值是( )
试题篮