View Code of Problem 36

#include "stdio.h"

void main()
{
	char s[100];
	int i,j;
	int a[100]={0};
	int t;
	scanf("%d\n",&t);
	for(j=0;j<t;j++)
	{
		gets(s);
		for(i=0;s[i]!='\0';i++)
		{
			a[s[i]-'A'+0]++;
		}
		for(i=0;i<100;i++)
		{
			if(a[i]!=0)
				printf("%d%c ",a[i],'A'+i);
		}
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 36