jakaria_hossain

Toph - word count

Oct 2nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. map<string,int>mp;
  5. string ans;
  6. int mx=0;
  7. void counting(string s)
  8. {
  9. mp[s]++;
  10. if(mp[s]>mx)mx=mp[s],ans=s;
  11. }
  12. int main()
  13. {
  14. string a;
  15. while(cin>>a)counting(a);
  16. return cout<<ans<<endl,0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment