题型:综合题 题类:常考题 难易度:困难
浙江省温州市六校协作体2018届高三上学期信息技术期末联考试卷
程序界面如图所示:
Dim a(1 To 10)As Integer
Function find(L As Integer,R As Integer,key As Integer)As Integer
If L>R Then
find=0:Exit Functionhp
ElseIf a(L)>=key Then
find=L:Exit Function
Else
①
If a(M)<key Thenhp
find=find(M+1,R,key)
ElseIf ② Then
find=find(L,M-1,key)
Else
find=M
End If
End If
End Function
Private Sub Command1 Click()
Dim k As Integer
Dim P As Integer
k=Val(Text1.Text)
③
Text2.Text=a(P)
Text3.Text=Str(P)
If p=0 Then
Text2.Text=“无”
End If
End Sub
Private Sub Form Load()
a(1)=3:a(2)=3:a(3)=3:a(4)=4:a(5)=7:a(6)=7
a(7)=10:a(8)=13:a(9)=19:a(10)=21
For i=1 To 10
List1.AddItem Str(a(i))
Next i
End Sub
① ② ③
加密规则如下表所示:
原字 |
A |
B |
C |
… |
X |
Y |
Z |
a |
b |
c |
… |
x |
y |
z |
密字 |
z |
y |
x |
… |
c |
b |
a |
Z |
Y |
X |
… |
C |
B |
A |
注:“A”的ASCⅡ码值是65,“a”的ASCI码值是97。
试题篮