试题 试卷
题型:综合题 题类:常考题 难易度:困难
浙江省杭州市2016年信息技术高考模拟卷一
Private Sub Command1Click()
Dim Year As Integer
①
If (Year Mod 4 = 0) And (Year Mod 100 <> 0) Or (Year Mod 400 = 0) Then
Text2.Text = "是闰年"
Else
Text2.Text = "不是闰年"
End If
End Sub
为实现上述功能, 程序①加框处应填写为
Private Sub Command1 click( )
Dim a(1 to 3) as integer,k as integer,t as integer,s as integer
a(1)=15: a(2)=36: a(3)=7
s=0
For k=2 to 3
if a(k)>a(1) then
t=a(1):a(1)=a(k):a(k)=t
s=s+1
End if
Next k
text1.text=str(a(1))
text2.text=str(s)
End sub
某旅客退房了,需要把这房子也登记上去,有四种情况需要处理:
1)上靠,例如退的房间号为3,则原来登记的3条记录变成(1 , 3), (6,3), (10,1).
2)下靠,例如退的房间号为5,则原来登记的3条记录变成(1,2), (5 , 4), (10,1).
3)上下不靠,例如退的房间号为4,则登记的记录数变成4条(1,2) ,(4 , 1), (6,3),(10,1).
4)上下靠,例如退的房间号为9,则登记的记录数变成2条(1,2),(6,5).
小王依据上述描述设计了如下VB程序。请回答下列问题:
试题篮