试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 算法及VB语言表达基础同步练习
Private Sub Command1_Click()
Dim a As Integer,b As Integer
a=10 ‘①
b=20 ‘②
Text1.Text=“a+b=”+Val(a+b) ‘③
End Sub ‘④
发生“类型不匹配”错误时所执行的语句是( )
Private Sub Commandl_Click()
Dim i As Integer,j As Integer.s As String
Dim a(1 To 5) As Integer
List1.Clear
Randomize
For i=1 To 10
j=Int(Rnd*6)+1
a(j)=a(j)+1
Next i
For i=1 To 5
s=Str(a(i))
List1.AddItem s
End Sub
程序运行时,单击按钮Commandl后弹出如图所示的错误提示。出现错误的语句是( )
依次输入x的值为5、3、-1后,该算法的输出结果为( )
小明依据上述描述设计了如下VB程序,在Text1中输入矩阵的行数n (n≤10),单击“生成”按钮Command1,在List1中显示n×n的螺旋矩阵。请回答下列问题:
试题篮