同じシードで初期化されたrand48系関数は毎回同じ数列を返す
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int i, seed; | |
double r; | |
seed = 1533627; | |
srand48(seed); | |
for (i = 0; i < 5; ++i) { | |
r = drand48(); | |
cout << r << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment