Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <random>
- using namespace std;
- int main(int argc, char const *argv[])
- {
- const int MIN = 1;
- const int MAX = 100;
- const int COUNT = 10;
- random_device rd;
- uniform_int_distribution<int> dist(MIN, MAX);
- set<int> random_pool;
- while (random_pool.size() < COUNT)
- {
- random_pool.insert(dist(rd));
- }
- for (int r : random_pool)
- {
- cout << r << '\t';
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement