View Code of Problem 36

#include<stdio.h>
int main()
{
	char str[1000];
	int t,i,a[100]={0},k;
	scanf("%d",&t);
	while(t--)
	{   k=0;
		gets(str);
		for(i=0;str[i]!='\0';i++)
		{
			a[str[i]-64]++;
		 } 
		for(i=1;i<27;i++)
		{    if(a[i]==0)
		       continue;
		    else
			 printf("%d%c",a[i],i+64);
		 } 
	}
 }

Double click to view unformatted code.


Back to problem 36