Facebook
From adsad, 5 Months ago, written in C++.
Embed
Download Paste or View Raw
Hits: 356
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.    int t;
  6.    cin>>t;
  7.    for(int i=0;i<t;i++){
  8.     string s;
  9.     getline(cin,s);
  10.     map<char,int>mp;
  11.     for(int i=0;i<s.size();i++){
  12.             if(s[i]!=' ')
  13.             mp[s[i]]++;
  14.     }
  15.     for(auto it:mp){
  16.         cout<<(it).first<<" "<<(it).second<<endl;
  17.     }
  18.  
  19.    }
  20. }
  21.  

Replies to Untitled rss

Title Name Language When
Re: Untitled asda cpp 5 Months ago.