Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <vector>
- #include <unordered_set>
- using namespace std;
- void unique_elements()
- {
- int n;
- string st;
- unordered_multiset<int> u_set;
- vector<int> vec;
- stringstream ss;
- getline(cin, st);
- ss << st;
- while (ss >> n)
- {
- u_set.insert(n);
- }
- for (auto& it : u_set)
- {
- if (u_set.count(it) == 1)
- {
- vec.push_back(it);
- }
- }
- for (auto &it : vec)
- {
- cout << it << " ";
- }
- }
- int main()
- {
- unique_elements();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement