View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36