[VB6 ] 關於程式的一些問題

作者: ybigghost (鯊魚)   2013-08-07 03:35:50
Private Sub Command1_Click()
Dim a(1 To 10) As Integer
a(1) = Val(Text1): a(2) = Val(Text2): a(3) = Val(Text3): a(4) = Val(Text4): a(5) = Val(Text5): a(6) = Val(Text6): a(7) = Val(Text7): a(8) = Val(Text8): a(9) = Val(Text9): a(10) = Val(Text10)
n = 10
For i = 1 To n
Next i
For i = n - 1 To 1 Step -1
For j = 1 To i
If a(j) > a(j + 1) Then
t = a(j)
a(j) = a(j + 1)
a(j + 1) = t
End If
Next j
Next i
For Each s In a
Next
Msgbox "由小到大=" & s
End Sub
寫了這一段
我該怎麼讓 Msgbox 輸出 我從小到大的答案呢??
Print 測試 正常 沒算錯
vb 新手 懇求幫忙

Links booklink

Contact Us: admin [ a t ] ucptt.com