Saleh127

UVA 10420

Apr 16th, 2020 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. string a,b;
  6. int t;
  7. cin>>t;
  8. map<string,int>c;
  9. for(int i=0; i<t; i++)
  10. {
  11. cin>>a;
  12. getline(cin,b);
  13. c[a]++;
  14. }
  15. map<string,int>::iterator d;
  16. for(d=c.begin();d!=c.end();++d)
  17. {
  18. cout<<d->first<<" "<<d->second<<endl;
  19. }
  20. return 0;
  21. }
Add Comment
Please, Sign In to add comment