题型:综合题 题类:常考题 难易度:困难
浙江省杭州市2017-2018学年高三上学期信息技术教学质量检测
位置 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
数据 |
64 |
67 |
45 |
145 |
|
269 |
|
|
|
119 |
1275 |
Const n=97
Dim d(0 To 96)As Integer,h(0 To 96)As Integer
Dim m As Integer ‘变量m为数据个数
Private Sub Command1_Click() ‘数据存储
Dim i As Integer,t As Integer
‘从数据库读取数据先存储在数组d中,代码略
List1.Clear
For i=0 To n-1
h(i)=-1 ‘数组元素初始化
Next i
For i=0 To m
①
Do While h(t)<>-1
t=(t+1)Mod l2
Loop
h(t)=d(i)
Next i
For i=0 To n-1
List1.AddItem Str(i)&“:”&Str(h(i))
Next i
End Sub
Private Sub Command2_Click() ‘数据查找
Dim x As Integer,Y As Integer,z As Integer
x=Val(Text1.Text)
y=x Mod n
z=1
Do While ②
z=z+1
y=(y+1)Mod n
Loop
If h(y)=x Then
Label2.Caption=“共查找了”&Str(z)&“次,在第”&,Str(y)&“位置找到”
Else
Label2.Caption=“共查找了”&Str(z)&“次,没有找到”
End If
End Sub
① ②
试题篮