View Code of Problem 36

#include<stdio.h>

int main()
{
	int t;
	char s[1005];
	scanf("%d", &t);
	getchar();
	while(t--)
	{
		int n[26]={0};
		scanf("%s", s);
		for(int i = 0; s[i] != '\0'; i++)
			n[s[i]-65]++;
		for(int i = 0; i < 26; i++)
			if(n[i] != 0)
				printf("%d%c", n[i], i+65);
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36