View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36