Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <random>
- using namespace std;
- int main()
- {
- //seed
- random_device seed{};
- //rnd gen
- mt19937 engine{seed()};
- //uniform distribution [1..10]
- uniform_int_distribution<> dis{1, 10};
- //generate random number
- int x{ dis(engine) };
- //output
- cout << x << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement