[填空题] 下列程序为比较排序法排序程序,请补充完该程序(该程序对10个数值数据进行排序处理)。 Dim a(1 To 10)AS Integer Private Sub Form _Click()

19 查阅

[填空题] 下列程序为比较排序法排序程序,请补充完该程序(该程序对10个数值数据进行排序处理)。 Dim a(1 To 10)AS Integer Private Sub Form _Click() Randomize p=“” For i = 1 To 10 Do x = Int (Rnd * 90) + 10 yes = 0 For j = 1 To 【9】 If x = a(j) Then yes = 1: Exit For Next Loop While yes = 1 a(i) = x Next i For i = 1 To 9 For 【10】 To 10 If a(i) > a(j) Thent = a(i)【11】 a(j) = t End If Next j Next i p = Str(a(1)) For i = 2 To 10 p = p & “,” & Str(a(i)) Print p Next i End Sub

参考答案:

[9] i-1 [10] j=1 [11] a(i)=a(j)

计算机考试