#include #include using namespace std; int main() { int i; int seed; random_device rd; cout << "The random_device" << endl; cout << "Entropy: " << rd.entropy() << endl; cout << "The fist ten numbers " << endl; for (i = 0; i < 10; i++) { cout << rd() << endl; } cout << endl << endl; minstd_rand lce; if (rd.entropy() > 0) { seed = rd(); } else { seed = static_cast(time(nullptr)); } lce.seed(seed); cout << "The linear_congruential_engine" << endl; cout << "The fist ten numbers " << endl; for (i = 0; i < 10; i++) { cout << lce() << endl; } cout << endl << endl; // you see this in gregory seed = rd.entropy() ? rd() : static_cast(time(nullptr)); mt19937 smt; smt.seed(seed); cout << "The 32 bit mersenne twister" << endl; cout << "The fist ten numbers " << endl; for (i = 0; i < 10; i++) { cout << smt() << endl; } cout << endl << endl; seed = rd.entropy() ? rd() : static_cast(time(nullptr)); mt19937_64 mt; mt.seed(seed); cout << "The 64 bit mersenne twister" << endl; cout << "The max value is " << mt.max() << endl; cout << "The fist ten numbers " << endl; for (i = 0; i < 10; i++) { cout << mt() << endl; } cout << endl << endl; return 0; }