大家帮忙看看哪里错了 说是下标越界
PrivateSubForm_click()DimiAsInteger,jAsInteger,tAsIntegerDima(0To9)AsIntegerRandomize...
Private Sub Form_click()
Dim i As Integer, j As Integer, t As Integer
Dim a(0 To 9) As Integer
Randomize
Print "原始数据:"
For i = 0 To 9
a(i) = Int(61 * Rnd + 20)
Print a(i);
Next i
Print
For i = 0 To 9
For j = i + 1 To 10
If a(i) > a(j) Then
t = a(i): a(i) = a(j): a(j) = t
End If
Next j
Next i
Print "排序结果为:"
For j = 1 To 10
Print a(j);
Next j
End Sub 展开
Dim i As Integer, j As Integer, t As Integer
Dim a(0 To 9) As Integer
Randomize
Print "原始数据:"
For i = 0 To 9
a(i) = Int(61 * Rnd + 20)
Print a(i);
Next i
For i = 0 To 9
For j = i + 1 To 10
If a(i) > a(j) Then
t = a(i): a(i) = a(j): a(j) = t
End If
Next j
Next i
Print "排序结果为:"
For j = 1 To 10
Print a(j);
Next j
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询