Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <random>
- #include <set>
- int main() {
- std::random_device rd;
- std::mt19937 mt(rd());
- std::uniform_real_distribution<int> dist(1, 10);
- int size;
- std::set<int> numbers;
- std::cin >> size;
- while (numbers.size() < size) {
- numbers.insert(dist(mt));
- }
- for (const auto& n : numbers) {
- std::cout << n << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment