题型:单选题 题类:常考题 难易度:普通
浙江省“七彩阳光”2020届新高考研究联盟高三信息技术12月适应性考试试卷
例如,有如下年龄存在数组a中:
a(1) | a(2) | a(3) | a(4) | a(5) | a(6) | a(7) | a(8) | a(9) | a(10) |
20 | 19 | 18 | 19 | 15 | 12 | 15 | 20 | 17 | 19 |
利用一个数组b(b(10 To 20))记录每个数出现的次数:
b(10) | b(11) | b(12) | b(13) | b(14) | b(15) | b(16) | b(17) | b(18) | b(19) | b(20) |
0 | 0 | 1 | 0 | 0 | 2 | 0 | 1 | 1 | 3 | 2 |
根据数组b对数组a进行排序:
a(1) | a(2) | a(3) | a(4) | a(5) | a(6) | a(7) | a(8) | a(9) | a(10) |
12 | 15 | 15 | 17 | 18 | 19 | 19 | 19 | 20 | 20 |
Dim a(10000) As Integer ‘存放读入的年龄数据
Dim b(100) As Integer ‘存放各个年龄出现的个数
Private Sub Command1_Click()
‘从数据库读入年龄数据放入数组a中
End Sub
Private Sub Command2_Click()
For i = 1 To 100
b(i) = 0
Next i
For i = 1 To 10000 ‘统计每个年龄数据的个数
①
Next i
End Sub
Private Sub Command3_Click()
j = 0
For i = 1 To 100
If b(i) <> 0 Then
Do While b(i) <> 0
②
a(j) = i
‘③
Loop
End If
Next i
For i = 1 To 10000
List2.AddItem Str(a(i))
Next i
End Sub
试题篮