试题 试卷
题型:单选题 题类:常考题 难易度:容易
内蒙古巴彦淖尔市临河三中计算机班2018-2019高二下学期信息技术期中考试试卷VB
Dim a(1 to 10)as integer
Pos=-1
i=1
do while i<=10
if i mod 2=0 then a(i)=i*2 else a(i)=i
i=i+1
loop
i=10
do while i>=1
if a(i)=12 then Pos=i
i=i-1
该程序段运行后,变量Pos值是( )
For i = 1 To 6
a(i) = Int(Rnd * 10) + 1
Next i
For i = 2 To 6
If i Mod 2 = 0 And a(i)>a(i-1) Then
t=a(i):a(i)=a(i-1):a(i-1)=t
Else
a(i)=a(i)-1
End If
执行程序后,数组元素a(1)到a(6)的值可能是( )
Dim a(1 To 5) As Integer
a(1) = 1
For i = 2 To 5
a(i) = Int(Rnd * 5) + 1
If a(i) Mod 2 = 0 Then
a(i) = a(i) + i
a(i) = a(i) + a(i - 1)
a(1)~a(5)的值不可能的是( )
试题篮