Skip to content

Instantly share code, notes, and snippets.

@aximov aximov/drand48.cc
Created Jul 6, 2018

Embed
What would you like to do?
同じシードで初期化された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
You can’t perform that action at this time.