fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <random>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. mt19937 gen(random_device{}());
  10. exponential_distribution<> d(0.1);
  11.  
  12. for(int n=0; n<100; ++n)
  13. cout << d(gen) << endl;
  14. }
  15.  
Success #stdin #stdout 0s 4896KB
stdin
Standard input is empty
stdout
0.588284
10.3379
0.520697
0.925109
2.1551
0.924945
6.68461
4.17187
9.374
3.16692
3.16844
4.65412
0.681791
2.17386
13.8116
0.403397
5.81181
9.66642
14.9061
4.72536
4.7587
0.261154
21.7362
13.7787
1.00701
1.95957
6.06603
11.4492
26.0578
3.34221
2.56626
7.84857
8.2998
6.59188
0.0162547
13.6744
20.4013
22.7251
8.09013
24.3936
4.38823
5.71586
16.3542
8.24821
14.4732
4.70711
18.1618
8.29602
4.18779
13.4121
17.9307
5.59618
2.32837
7.87424
28.348
9.72603
9.20831
1.66001
5.0548
1.80488
1.87409
25.8801
38.3347
11.1884
33.1756
10.3268
7.78114
9.59444
5.71404
7.95823
36.7118
0.0353611
8.10041
10.707
37.4753
1.80888
1.90972
9.70692
4.21212
49.3786
6.65636
13.4928
33.1113
6.22128
6.42761
0.759692
2.44532
6.00419
4.78954
2.39734
52.2572
0.725849
6.8103
5.19531
4.13582
12.3354
20.9819
15.7913
21.5506
0.784873