View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36