Facebook
From asda, 7 Months ago, written in C++.
This paste is a reply to Untitled from adsad - view diff
Embed
Download Paste or View Raw
Hits: 389
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.    int t;
  6.    cin>>t;
  7.    cin.ignore();
  8.    for(int i=0;i<t;i++){
  9.     string s;
  10.  
  11.     getline(cin,s);
  12.     transform(s.begin(),s.end(),s.begin(),::toupper);
  13.     map<char,int>mp;
  14.     for(int i=0;i<s.size();i++){
  15.             if(s[i]!=' ')
  16.             mp[s[i]]++;
  17.     }
  18.     for(auto it:mp){
  19.         cout<<(it).first<<" "<<(it).second<<endl;
  20.     }
  21.  
  22.    }
  23. }
  24.