BubbleSort を実装しようとしています。ただし、配列の範囲外のエラーが発生します。これは 3 行目で発生します。誰かが私に何がうまくいかないのか説明できますか?
For i As Integer = 0 To marks.Length Step 1
For x As Integer = 0 To marks.Length - 1 Step 1
If marks(x) > marks(x + 1) Then <<< "this where the problem is"
temp = marks(x + 1)
marks(x + 1) = marks(x)
marks(x) = temp
End If
Next x
Next i
For a As Integer = 0 To marks.Length
MsgBox(marks(a))
Next