View Code of Problem 36

#include <stdio.h>
#include <string.h> 

int main()
{
	int i,T;
	
	char s[1000];
	scanf("%d",&T);
	while(T--)
	{
		int n[100]={0};
		scanf("%s",s);
		//gets(s);
		for (i=0;i<strlen(s);i++)
			n[s[i]]++;
		for (i='A';i<'Z';i++)
		{
			if (n[i]==0) continue;
			else printf("%d%c",n[i],i);
		}
		printf("\n");
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36