View Code of Problem 36

#include<stdio.h>
int main()
{
	int i,j, a, b, c,k,num,x;
	int T;
	char q[10000];
	char p[10000];
	scanf("%d", &T);
	for (i = 0; i < T; i++)
	{
		scanf("%s", q);
		num = 0;
		k = 0;
		x = 0;
		do
		{
			for (j = 0; j < strlen(q); j++)
			{
				if (q[j] == 'A' + k)
				{
					num++;
				}
			}
				if (num != 0)
				{
					printf("%d%c", num, 'A' + k);
				}
			k++;
			num = 0;
		} while (k <= 25);
		printf("\n");
	}
}

Double click to view unformatted code.


Back to problem 36