View Code of Problem 36

#include<iostream>
#include<string.h>
using namespace std;
int main()
{   int t;
	char str[1000];
	cin>>t;
	while(t)
	{ 
	  cin>>str;
	  int a[1000]={0};
	  for(int i=0;i<strlen(str);i++)
	    {
		  a[str[i]]++;
		}
	for(int j=65;j<91;j++)
   { 
     if(a[j]!=0)
	 {
   	  cout<<a[j]<<(char)j;
	 }
   }		
	t--;
	}
  	
} 

Double click to view unformatted code.


Back to problem 36