1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <random>
using namespace std;
int main(){
mt19937 engine {1};
normal_distribution<float> nd {0, 1};
for (int i=0; i<10; i++){
for (int j=0; j<=i; j++) {
cout << nd(engine) << endl;
}
cout << endl;
engine.seed(1);
nd.reset();
}
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
g++ -std=c++17 -O2 -Wall -pedantic -pthread main.cpp && ./a.out
0.3064

0.3064
0.156066

0.3064
0.156066
-0.424386

0.3064
0.156066
-0.424386
-0.56804

0.3064
0.156066
-0.424386
-0.56804
-0.204547

0.3064
0.156066
-0.424386
-0.56804
-0.204547
-0.806289

0.3064
0.156066
-0.424386
-0.56804
-0.204547
-0.806289
-0.428738

0.3064
0.156066
-0.424386
-0.56804
-0.204547
-0.806289
-0.428738
-1.20004

0.3064
0.156066
-0.424386
-0.56804
-0.204547
-0.806289
-0.428738
-1.20004
1.30547

0.3064
0.156066
-0.424386
-0.56804
-0.204547
-0.806289
-0.428738
-1.20004
1.30547
-1.18775