试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 算法及VB语言表达基础同步练习
For i = 1 To 3
For j = 1 To 10
If j Mod i = 0 Then a(j) = 1 - a(j)
Next j
Next i
sum = 0
For i = 1 To 10
sum = sum + a(i)
已知数组a的所有元素初值均为0,运行上述程序段后,变量sum的值是( )
Dim a As Integer, b As Integer, c As Integer, y As Integer
a=3:b=4:c=4
If a<=b And c<=a Then
y=a+b
ElseIf a<=b or b<=c Then
y=b+c
ElseIf b=c Then
y=a mod c
Else
y=a+b+c
End If
该程序段运行之后,变量y的值为( )
Dim a(0 To 9) As Integer, t as Long
t=Val(Text1.Text)
Do While t<>0
a(t Mod 10) = 1
t = t \ 10
Loop
For i = 0 To 9
x = x + a(i)
Text1中输入10242048,则程序执行后x的值为( )
a=1
b=a+1
print(a,b)
试题篮