看板 Visual_Basic 關於我們 聯絡資訊
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
smaljohn:感謝^^ 203.67.56.83 05/29