试题 试卷
题型:单选题 题类:模拟题 难易度:普通
浙江省2019年信息技术选考模拟试卷二
For i=1 to n
j = 1
a(j)=a(j)+1
Do While a(j)>7
a(j)=0 : j=j+1 : a(j)=a(j)+1
Loop
Next i
当n=102时,执行程序结束后数组a中各元素相加的和为( )
flag = True : i = 1
Do While i <= 6
x = Int(Rnd * 100) + 1
If flag Or x >50 Then
a(i)=x
flag = Not flag
i = i + 1
End if
执行该程序段后,在下列选项中,a(1)~a(6)各元素值不可能的是( )
Private Sub Command1_Click()
Dim s As String, a As String, t As String
s = Text1.Text: t = ""
For i = 1 To Len(s)
a = Mid(s, i, 1)
If a >= "0" And a <= "9" Then
t = t + a
ElseIf a = "!" Then
t = ""
ElseIf t <> "" Then
List1.AddItem t
End If
End Sub
在文本框Text1中输入“12+23=35!456Ye”,单击按钮“Command1”后,在列表框List1中显示的结果是( )
For i=1 to 30
If i mod 5=0 then
s=s+i
i=i+6
end if
next i
小明依据上述描述设计了如下VB程序,在Text1中输入矩阵的行数n (n≤10),单击“生成”按钮Command1,在List1中显示n×n的螺旋矩阵。请回答下列问题:
For i = 1 To 9 Step 2
b(a(i) Mod 10) = b(a(i) Mod 10) + 1
s = 0
For i = 0 To 9 Step 3
s =s + b(i)
数组b各元素初始值为0, 数组元素a(1)到a(9)的值依次为“29,74,12,38,16,45,21,57,33”,则执行该程序段后,s的值为( )
试题篮