[求助]请看看我这个简单的程序问题出在哪?
我求一次小值,用vb编了个界面,但算出来结果不对,下面是我的程序,请帮忙看看,谢谢了!Private Sub dminCommand_Click()
Dim a(14), T As Double
Dim I, J, N As Integer
a(0) = numberInput1(0).Text
a(1) = numberInput2(1).Text
a(2) = numberInput3(2).Text
a(3) = numberInput4(3).Text
a(4) = numberInput5(4).Text
a(5) = numberInput6(5).Text
a(6) = numberInput7(6).Text
a(7) = numberInput8(7).Text
a(8) = numberInput9(8).Text
a(9) = numberInput10(9).Text
a(10) = numberInput11(10).Text
a(11) = numberInput12(11).Text
a(12) = numberInput13(12).Text
a(13) = numberInput14(13).Text
a(14) = numberInput15(14).Text
N = number.Text
For J = 0 To N - 2
For I = 0 To N - J - 2
If a(I) > a(I + 1) Then
T = a(I)
a(I) = a(I + 1)
a(I + 1) = T
End If
Next I
Next J
For I = 0 To N - 1
Print a(I)
Next I
dminOutput.Text = a(1)
End Sub
但如果把a(0) = numberInput1(0).Text
a(1) = numberInput2(1).Text
a(2) = numberInput3(2).Text
a(3) = numberInput4(3).Text
a(4) = numberInput5(4).Text
a(5) = numberInput6(5).Text
a(6) = numberInput7(6).Text
a(7) = numberInput8(7).Text
a(8) = numberInput9(8).Text
a(9) = numberInput10(9).Text
a(10) = numberInput11(10).Text
a(11) = numberInput12(11).Text
a(12) = numberInput13(12).Text
a(13) = numberInput14(13).Text
a(14) = numberInput15(14).Text
它们改成a(0) = 548
a(1) =658
a(2) = 987
a(3) = 4645665
a(4) = 5485
a(5) = 785
a(6) = 1555
a(7) = 85
a(8) = 54
a(9) = 98
a(10) = 155
a(11) = 5855
a(12) = 1458
a(13) = 587
a(14) = 6454
就是直接改成数字就没问题,什么原因阿,谢谢