vb提示下标越界问题
PrivateSubForm_Load()DimiAsInteger,a()AsIntegerOpen"d:\1.txt"ForInputAs1Fori=1To999Fo...
Private Sub Form_Load()
Dim i As Integer, a() As Integer
Open "d:\1.txt" For Input As 1
For i = 1 To 999
For j = 1 To 1000 - i
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j
Next i
Close 1
For j = 1 To 1000
Print a(j)
Next j
End Sub 展开
Dim i As Integer, a() As Integer
Open "d:\1.txt" For Input As 1
For i = 1 To 999
For j = 1 To 1000 - i
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j
Next i
Close 1
For j = 1 To 1000
Print a(j)
Next j
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询