View Code of Problem 36

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int T;
	cin>>T;
	string s;
	while(T--)
	{
		map<char,int>m;
		map<char,int>::iterator it;
		cin>>s;
		for(int i=0;i<s.size();i++)
		{
			if(s[i]>='A'&&s[i]<='Z')
			{
				m[s[i]]++;				
			}
		}
		for(it=m.begin();it!=m.end();it++)
		{
			if(it->second>0)
			{
				cout<<it->second<<it->first;
			}
		}
		cout<<endl;
	}
} 

Double click to view unformatted code.


Back to problem 36