Skip to content

Instantly share code, notes, and snippets.

@aximov
Created July 6, 2018 04:06
Show Gist options
  • Save aximov/3ff3bd8cf2df46be80443de75f2674ce to your computer and use it in GitHub Desktop.
Save aximov/3ff3bd8cf2df46be80443de75f2674ce to your computer and use it in GitHub Desktop.
同じシードで初期化された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