试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省台州市黄岩第二高级中学2017-2018学年高二下学期信息技术期中考试试卷
a(1)=1:a(2)=1
b(1)=1:b(2)=2
for i=3 to 5
a(i)=a(i-1)+a(i-2)
b(i)=b(i-1)+a(i)
next i
执行该段程序后,数组元素b(5)的值为( )
Fori=1To5
b(a(i))=b(a(i))+1
Nexti
t=0
Forj=1To10
Fork=1Tob(j)
t=t+1:a(t)=j
Nextk
Nextj
a(1)到a(5)d初值依次是7、5、9、4、3,程序段运行后,数组a的值依次是()
s = "123456789"
g = ""
For i = 1 To 3
n = Len(s)
x = Int(Rnd * n) + 1
g = g + Mid(s, x, 1)
s = Mid(s, 1, x - 1) + Mid(s, x + 1, n - x)
Next i
在程序执行时,若变量x的值依次为3,3,6,则最终变量g的值为( )
Dim a (1 To 6) As Integer
Randomize
a(1) = Int (Rnd*2) + 1
For i = 2 To 6
a(j) = Int (Rnd*i) *2 + 1
If a(i) < a(i-1) Then
a(i) = a(i) + a(i-1)
End If
执行该程序段后,数组元素a(1)到a(6)的值可能是( )
试题篮