看板 Fortran 關於我們 聯絡資訊
如下,在很短的時間內,重複 呼叫 random_seed(), 會得到 相同的 種子數, 產生相同序列的亂數, 所以,必須寫 一個副程式來處理 這個問題。 1 0.2611238 2 0.2611238 3 0.2611238 4 0.2611238 5 0.2611238 6 0.2611238 7 0.2611238 8 0.2611238 9 0.2611238 10 0.2611238 Press any key to continue program VF1019 implicit none integer i, j, k real x, y, z do i=1, 10 CALL RANDOM_SEED() CALL RANDOM_NUMBER(x) print *, i, x end do end program VF1019 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.20.178.154
souffrance:其實可以不用什麼都用副程式 random seed寫個小算式就 10/20 11:52
souffrance:能解決了 10/20 11:52