试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省湖州市2018-2019学年高二下学期信息技术期末考试试卷
Do While i <= n
x = Int(Rnd() * 9) + 1 If x Mod 2 = 1 Then
a(i) = x Else
a(n) = x n = n - 1
End If
i = i + 1 Loop
数组元素的初值均为 0,执行该程序段后,在下列选项中 a(1)至 a(5)各元素值不可能的是( )
e=0
For i=2 to 10 step 2
For j=1 to 6
If (i+j) mod 3=0 then e=e+1
Next j
Next i
i = 1: j = 7: s = ""
key = 34
Do While i <= j
m = (i + j) \ 2
If key = a(m) Then
s = s + "2": Exit Do 'Exit Do 表示退出循环
ElseIf key < a(m) Then
j = m - 1: s = s + "1"
Else
i = m + 1: s = s + "3"
Loop
Text1.Text = s
数组元素a(1)到a(9)的值依次为“15,26,34,47,53,59,60,72,85”。若该程序段执行后,文本框Text1中显示的内容可能是( )
Dim a(1 To 10) As Integer
a(1)=2: a(2)=18: a(3)=10: a(4)=34: a(5)=16
a(6)=7: a(7)=37: a(8)=6: a(9)=15: a(10)=15
c=0: x=0: t= 1
For i=1 To 10
a(i)=a(i)*t
c=c+a(i)
If c>0 Then x=x+1
t=-t
Text1.Text=Str(x)
则程序运行后Text1中显示( )
试题篮