View Code of Problem 36

#include<stdio.h>
int main()
{
	int t;
    scanf("%d",&t);
	getchar();
	while(t>0)
	{
	int a[26]={0};
	char str[1000];
	scanf("%s",str);
    int i;
	for(i=0;str[i]!='\0';i++)
	a[str[i]-'A']++;
	for(i=0;i<26;i++)
	{
		if(a[i]) printf("%d%c",a[i],i+'A');
	}
	printf("\n");
	t--;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36