Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <cstdio>
- #include <vector>
- #include <iostream>
- #include <algorithm>
- #include <unordered_map>
- using namespace std;
- int main() {
- unordered_map<string, int> words;
- string word;
- while(cin >> word) {
- words[word]++;
- }
- vector<string> result;
- for(auto i : words){
- if(i.second == 1){
- result.push_back(i.first);
- }
- }
- sort(result.begin(), result.end());
- for(string currWord : result){
- cout << currWord << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment