题型:综合题 题类:模拟题 难易度:困难
浙江省普通高校招生信息技术选考模拟卷(二)
Const n = 10
Dim d(1 To n) As Integer, pm(1 To n) As Integer
Private Sub Form_Load()
'代码略,本过程功能:产生10个随机整数存数组d中,并在列表框list1 中显示。
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer, t As Integer
i = 1
Do While i <= n - 1
k = i
For j = i + 1 To n
If Then k = j ‘①
Next j
If i <> k Then t = d(i): d(i) = d(k): d(k) = t
i = i + 1
Loop
pm(1) = 1
For i = 2 To n
If Then ‘②
pm(i) = i
Else
pm(i) = pm(i - 1)
End If
Next i
For i = 1 To n
List2.AddItem Str(i) +" " +Str(d(i)) + " " + "第" + Str(pm(i)) + "名"
Next I
End Sub
① ②
试题篮