问题
问答题
VB程序设计题。
下列是选择排序法实现对数组a(n)进行升序排序的程序段。要求,请将程序中横线上的内容补充完整。
Sub Sort ()
Dim i as Integer, j as Integer, k as Integer, t as Integer
For i=1 to n-1
k=i
For j=i+1 to n
If a(j)()a(k) then
k=j
End if
Next j
If(k<>j) then
()
()
a(k)=t
End if
Next i
End Sub
答案
参考答案:
< t=a(j) a(j)=a(k)