作者fumizuki (小獅)
看板Visual_Basic
標題Re: [請益] 請問關於do loop
時間Sun May 29 07:24:38 2005
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
1F:推 smaljohn:感謝^^ 203.67.56.83 05/29