Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- map<string,int>mp;
- string ans;
- int mx=0;
- void counting(string s)
- {
- mp[s]++;
- if(mp[s]>mx)mx=mp[s],ans=s;
- }
- int main()
- {
- string a;
- while(cin>>a)counting(a);
- return cout<<ans<<endl,0;
- }
Advertisement
Add Comment
Please, Sign In to add comment