View Code of Problem 36

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,i,j;
	char a[1005],c;
	cin>>t;
	getchar();
	while(t--)
	{
		c='A';
		int s=0;
		cin>>a;
		for(j=0;j<26;j++)
		{
		for(int i=0;i<strlen(a);i++)
		{
		  	if(a[i]==c)
		  	s++;
		}
		if(s>=1)
		{
			cout<<s<<(char)c;
		}
		c=c+1;
		s=0; 
	}
	cout<<endl;
}
	return 0;
}

Double click to view unformatted code.


Back to problem 36