1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <random>
#include <iomanip>
int main() {
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<> distrib(0.0, 1.0);
std::cout << std::fixed << std::setprecision(6);
for (int i = 0; i < 5; ++i) {
std::cout << distrib(gen) << std::endl;
}
return 0;
}
Back to random