试题 试卷
题型:综合题 题类:常考题 难易度:困难
浙江省台州市书生中学2018-2019学年高二上学期信息技术第一次月考试卷
Private Sub Cmd1_Click()
Dim c As Integer, year As Integer
c=0
If Then
c=c+1
EndIf
Next year
Label1.Caption="闰年共有"+Str(c)+"次"
EndSub
n = 0
For i = 1 To Len(Text1.Text)
c = Mid(Text1.Text, i, 1)
If c >= "0" And c <= "9" Then m = 1 Else m = 2
a(m) = a(m) + 1
If a(m) = 1 Then n = n + 1
Next i
数组a各元素的初始值都为0,文本框Textl的内容为“Luck2018”。执行程序后,变量n的值为{#blank#}1{#/blank#}
Private Function f(x As Single, n As Integer) As Single
If n =0 Then
f =1
Else
If n Mod 2 =1 Then
f=x * f(x, n\2)
f=f(x, n\2) \x
End If
End Function
Private Sub Command1_Click()
Label1.Caption=Str(f(4, 6))
End Sub
程序运行时,单击按钮Command1,标签Label1显示的内容是( )
Private Sub Text1_Change()
Dim c As Integer, i As Integer
i=0
c = Val(Text1.Text)
Do While c >= 0
c = c - i
i = i + 1
Loop
Text1.Text = Str(c)
在文本框输入“6”,执行该程序段后, 其中c >= 0执行的次数是( )
i = n
Do While i >=2
k = i
For j = To 1 Step -1
If a(j) > a(k) Then k = j
Next j
If i <> k Then
t = a(k): a(k) = a(i): a(i) = t
则下列说法正确的是( )
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 '④
试题篮