[問題] 請問隨機變數的產生??
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
dev-c
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
有關隨機變數的產生方法??
srand(time(NULL));
int n= rannd()%10;
但似乎在某一段的時間(1秒多吧,不確定??)內,
所產生的值是相同的,可否在極短的時間產生多個亂數呢??
如1秒內產生100個變數??
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.26.133.114
→
06/12 01:04, , 1F
06/12 01:04, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章