试题 试卷
题型:单选题 题类:模拟题 难易度:普通
浙江省杭州市2016年信息技术高考模拟卷二
max=10 000
For i=1 To 10
s=0
For j=i To 10
s=s+a(j)
If s>max Then max=s
Next j
Next i
已知数组a(1)到a(10)的原始数据为6,-6,8,-7,7,2,-2,-1,-2,4。程序执行后,变量max的值为( )
图中空白处理框①和②处应填入的是( )
L = 0: R = 7: i = 1
Do While i < R
If a(i) = 0 Then
L = L + 1
t = a(i): a(i) = a(L): a(L) = t i = i + 1
ElseIf a(i) = 2 Then
R = R - 1
t = a(i): a(i) = a(R): a(R) = t
Else
i = i + 1
End If
Loop
数组元素 a(1)到 a(6)的值依次为“2,0,2,1,1,0”。执行该程序段后,下列说法不正确的是( )
Dim a(1 To 10) As Integer, f(1 To 20) As Boolean
'f数组各元素的初值设为False,代码略
For i = 1 To 10
t =int(rnd()*20+1)
If Not f(t) Then
a(i) = t: ⑴
For j = i To 2 Step -1
If ⑵ Then
tmp = a(j): a(j) = a(j - 1): a(j - 1) = tmp
⑶
上述程序中3处下划线应填入的程序代码是( )
试题篮