试题 试卷
题型:单选题 题类:模拟题 难易度:普通
浙江省杭州市2015年高考信息技术模拟卷5
Private Sub Command1 Click()
Dim a As Integer, b As Integer
a = 5: b = 8
b = a + b
label1.Caption = Str(b)
End Sub
引发此错误的语句可能为( )
Private Sub Command1_Click()
n = 6
x = 1
For i =1 To n
x = x * i
Next
End Sub( )
s = "123456789"
g = ""
For i = 1 To 3
n = Len(s)
x = Int(Rnd() * n) + 1
g = g + Mid(s, x, 1)
s = Mid(s, 1, x - 1) + Mid(s, x + 1, n - x)
Next i
在程序执行时,若变量 x 的值依次为3,3,6,则最终变量g的值为( )
s=“491053”
For i=1 To 3
n=Len(s)
k=1
For j=2 To n
If Mid(s, k, 1) >=Mid(s, j, 1) Then
K=j
Else
Exit For .Exit For表示退出循环
End If
Next j
s= Mid(s, 1, k-1) + Mid(s, k+ 1,n-k)
Label1.Caption =s
执行该程序段后,标签Label1中显示的值是( )
Function s(n As Integer) As Integer
If n=1 Then
s=1
s=s(n-1)+n
End Function
Private Sub Form_Click()
Dim x As Integer
x=s(4)
Print x
程序运行时,单击窗体后,变量x的值为( )
试题篮