试题

试题 试卷

logo

题型:综合题 题类:模拟题 难易度:困难

浙江省杭州市2016年信息技术高考模拟卷九

下列程序段实现对num数组进行排序,并将排序结果输出。

Private Sub Command1Click()

Dim num(0 To 5) As Integer

Dim i As Integer, j As Integer

Dim t As Integer

num(0) = 4: num(1) = 7: num(2) = 2: num(3) = 0: num(4) = 3: num(5) = 9

i = 0: j = 1: t = 0

For i = 1 To 5 Step 1

  For j = i + 1 To 4 Step 1

  If num(i) > num(j) Then

  t = num(i)

  num(i) = num(j)

  num(j) = t

  End If

  Next j

Next i

For i = 1 To 5

List1.AddItem num(i)

Next i

End Sub

(1)、程序段中使用的排序算法是
(2)、经过第一轮排序后num(2)的值是
举一反三
返回首页

试题篮