题型:综合题 题类:常考题 难易度:困难
浙江省嘉兴五中2019-2020学年高二下学期信息技术期中测试卷
请回答下列问题:
Const n = 6
Dim a(1 To n * n) As Integer
Private Sub Form_Load() '产生 n * n 个数组元素,每行按 n 个数显示在 list1 中
For i = 1 To n * n
a(i) = Int(Rnd * 90) + 10
s = s + Str(a(i))
If ① Then
List1.AddItem s
s = ""
End If
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, w As Integer, s As String
For i = 1 To n * n
k = i
For j = k + n To ②
If a(k) > a(j) Then k = j
Next j
If Then t = a(k): a(k) = a(i): a(i) = t
Next i
'将排序后数组 a 的元素,按每行 n 个数显示在 list2 中,代码略
End Sub
① ②
试题篮