试题 试卷
题型:单选题 题类:模拟题 难易度:困难
浙江省名校信息技术仿真训练卷(三)
s=Text1.Text
List1.Clear
Len1=Len(s) ‘①
For i=l To len1 ‘②
For j=1 To len1-i ‘③
List1.Addltem Mid(S,j,i) ‘④
Next j
Next i
运行时发现未输出所有子串,则修改( )
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
For i=1 To 5
s=Str(a(i))
List1.AddItem s
End Sub
程序运行时,单击按钮Commandl后弹出如图所示的错误提示。出现错误的语句是( )
Private Sub Command1_Click()
Dim sum As Double, x As Double
sum = 0
n = 0
For i = 1 To 5
x = n / i
n = n + 1
sum = sum + x
该程序通过For循环计算一个表达式的值,这个表达式是( )
Dim a As Integer, b As Integer
Dim c As Integer '①
a= Val(Text1. Text) '②
b = Val(Text2. Text)
c=a + b '③
Label1. Caption ="a + b="+c '④
试题篮