View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36