View Code of Problem 36

#include<stdio.h>
#include<string.h>
int main()
{
	int T;
	char a[1001];
	while (scanf("%d",&T)!=EOF)
	{
		if (T > 500) break;
		while (T--)
		{
			int b[26] = {0};
			scanf("%s", a);
			int len=strlen(a);
			for (int i = 0; i < len; i++)
			{
				b[a[i] - 65]++;
			}
			for (int i = 0; i < 26; i++)
			{
				if (b[i] != 0)
					printf("%d%c", b[i], i + 65);
			}
			printf("\n");
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36