作者ybigghost (鲨鱼)
看板Visual_Basic
标题[VB6 ] 关於程式的一些问题
时间Wed Aug 7 03:35:50 2013
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 新手 恳求帮忙
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.128.174