View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36