Private Sub Command1_Click() Cls Dim a(1 To 10) As Integer For i = 1 To 10 a(i) = InputBox("请输入第" & i & "个数值(共10个数)") Next i Print "您输入的十个数为:" For i = 1 To 10 Print a(i); Next i Print For m = 10 To 2 Step -1 For n = 1 To m - 1 If a(n) > a(n + 1) Then t = a(n) a(n) = a(n + 1) a(n + 1) = t End If Next n Next m Print "排序后为:" For i = 1 To 10 Print a(i); Next i End Sub