Dim flag, n(5) As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
Dim r, I, J As Integer
n(0) = Int(38 * Rnd()) + 1
For I = 1 To 5
Do
r = 0
n(I) = Int(38 * Rnd()) + 1
For J = 0 To I - 1
If n(I) = n(J) Then
r = 1
End If
Next
Loop While r = 1
Next
Array.Sort(n)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
Dim r, I, J As Integer
n(0) = Int(38 * Rnd()) + 1
For I = 1 To 5
Do
r = 0
n(I) = Int(38 * Rnd()) + 1
For J = 0 To I - 1
If n(I) = n(J) Then
r = 1
End If
Next
Loop While r = 1
Next
Array.Sort(n)
End Sub
全站熱搜
留言列表