Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include<string.h>
  3. #include<algorithm>
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6.  
  7. int main() {
  8. char words[][100] ={"new","old","new","oldbutnew","hello","old"};
  9. unordered_set<string> s;
  10. for (int i =0;i<6;i++){
  11. if(s.find(words[i])!=s.end())
  12. printf("\n%s",words[i]);
  13. else s.insert(words[i]);
  14. }
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement