Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <map>
- using namespace std;
- map<string,int> a;
- map<string,int>::iterator it;
- int main()
- {
- int n,i;
- string s;
- cin>>n;
- for(i=1;i<=n;i++)
- {
- cin>>s;
- a[s]++;
- }
- for(it=a.begin();it!=a.end();it++)
- if(it->second>1)
- cout<<it->first<<endl;
- // your code goes here
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement