题型:单选题 题类:常考题 难易度:困难
浙江省高中信息技术——选择排序
Private Sub Command1_ Click ( )
Dim a(1 To 5) As Integer, i As Integer, 3 As Integer, c As Integer
a(1) = 22: a(2) = 44: a(3) = 11: a(4) =33: a(5) = 55: c = 0
For i = 1 To 4
m = i
For j = i + 1 To 5
If a(i) > a(m) Then m = j
Next j
If m <> i Then
t=a(1) : a(i)=a(m) : a(m)=t
c=c+1
End If
Next i
Label1.Caption= Str (c)
End sub
该程序运行后,标签Label1中显示的内容是( )
a(1) | a(2) | a(3) | a(4) | a(5) | a(6) |
69 | 58 | 32 | 21 | 39 | 33 |
若采用冒泡排序算法对这组数据进行升序排列,那么在完成第一遍排序时,数组元素a(1)到a(6)的数据依次是( )
试题篮