Re: [請益] 請問關於do loop
Private Sub Command1_Click()
Dim r(3) As Integer, i As Integer, j As Integer, Exists As Boolean
Randomize
For i = 0 To 3
Exists = True
Do While Exists
Exists = False: r(i) = Fix(Rnd * 10)
For j = 0 To i - 1
If r(i) = r(j) Then Exists = True
Next
Loop
Print r(i)
Next
End Sub
--
VB 程式設計 倉木麻衣 PTT 星爺板 行列輸入法
======================================================
Visual_Basic MaiKuraki Stephen Array
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.58.156.43
推
203.67.56.83 05/29, , 1F
203.67.56.83 05/29, 1F
討論串 (同標題文章)
完整討論串 (本文為第 5 之 5 篇):
2
2
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章