View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36