View Code of Problem 36

#include <stdio.h>
#include <string.h>
main(){
	int T;
	scanf("%d",&T);
	while(T>0){
		int i,m;
		char str[1000];
		int letter[26] = {0};
		scanf("%s",&str);
		m = strlen(str);
		for(i = 0;i<m;i++){
			letter[str[i]-65]++;
		}
		for(i = 0;i<26;i++){
			if(letter[i]!=0)
				printf("%d%c",letter[i],i+65);
		}
		printf("\n");
		T--;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36