View Code of Problem 36

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

Double click to view unformatted code.


Back to problem 36