View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36