vb中next沒有for
Dim t As Integer
For i = 1 To 9
k = i
For j = i + 1 To 10
If a(k) < a(j) Then k = j
If a(k) <> a(j) Then
t = a(k): a(k) = a(j): a(j) = t
List1.AddItem Str(a(i))
End If
Next i
End Sub
Private Sub Form_Load()
n = 10
For i = 1 To 10
a(i) = Int(100 * Rnd)
List1.AddItem Str(a(i))
Next i
End Sub
你有
For j = i + 1 To 10
但沒有
next j
在
Next i
前面要加
Next j
的
Tags:vb
相關(guān)推薦
便查問答是一款實(shí)用的網(wǎng)絡(luò)熱門知識問答平臺,,專注于分享你不知道的知識、經(jīng)驗及生活問題,,在這里所有人都能找到答案歡迎網(wǎng)友參與討論,。