看板 Visual_Basic 關於我們 聯絡資訊
我想寫個像樂透模式差不多的程式 但是沒辦法像樂透一樣6個號碼 在加一個特別號,我一直都很煩惱,請各位高手告訴我加上一個特別號要怎麼寫 程式碼如下 Module Module1 Sub Main() Dim i, n, x As Long Console.WriteLine("樂透") For i = 1 To 6 Randomize() n = Int(Rnd() * 42) Console.WriteLine("中獎號碼" & n) Next Console.ReadLine() End Sub End Module -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.192.227.150
slanla:i=1 to 7不就好了~@@?只是要注意n=Int(Rnd()*42)會取到重複 03/29 13:09
xtimer:想偷問一下...原PO是哪個學校的~"~ 03/30 03:37
xtimer:這題目是我昨天的作業....XD 03/30 03:37