Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string.h>
- #include<algorithm>
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- char words[][100] ={"new","old","new","oldbutnew","hello","old"};
- unordered_set<string> s;
- for (int i =0;i<6;i++){
- if(s.find(words[i])!=s.end())
- printf("\n%s",words[i]);
- else s.insert(words[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement