2007-04-18 09:51:06ㄉ一ㄜˊ先生

世紀 程式

Dim lotto(49) As Integer

Dim i, j, no1, no2, temp As Integer


Randomize
For i = 1 To 49
lotto(i) = i
Next i
For i = 1 To 1000
no1 = Int(Rnd * 49) + 1
no2 = Int(Rnd * 49) + 1
temp = lotto(no1)
lotto(no1) = lotto(no2)
lotto(no2) = temp
Next i

Text1.Text = lotto(1)
Text2.Text = lotto(2)
Text3.Text = lotto(3)
Text4.Text = lotto(4)
Text5.Text = lotto(5)
Text6.Text = lotto(6)
Text7.Text = lotto(7)

For i = 5 To 1 Step -1
For j = 1 To i
If lotto(j) > lotto < (j + 1) Then
temp = lotto(j)
lotto(j) = lotto(j + 1)
lotto(j + 1) = temp
End

End Sub

Private Sub Command2_Click()
Text1.Text = ””
Text2.Text = ””
Text3.Text = ””
Text4.Text = ””
Text5.Text = ””
Text6.Text = ””
Text7.Text = ””

End Sub

Private Sub Command3_Click()
End
End Sub

上一篇:程式p88

下一篇:樂透有+特別號 程式