View Code of Problem 36

#include<iostream>
#include<map>
#include<cmath>
using namespace std;
int main(){
	map<char,int> mp;
	int T;
	cin>>T;
	while(T--){
		string str;
		cin>>str;
		for(int i=0;i<str.length();i++){
			if(str[i]>='A'&&str[i]<='Z'){
			
			mp[str[i]]++;
		}
	}
		for(map<char,int>::iterator it=mp.begin();it!=mp.end();it++){
			cout<<it->second<<it->first;
		}
		cout<<endl;
	}
}

 

Double click to view unformatted code.


Back to problem 36