#include<stdio.h> #include<string.h> int main(){ char str[100]; int a=-1,i,n,j,str1[26]; scanf("%d",&a); for(i=0;i<a+1;i++){ for(j=0;j<26;j++){ str1[j]=0; } gets(str); n=strlen(str); for(j=0;j<n;j++){ str1[str[j]-65]++; } for(j=0;j<26;j++){ if(str1[j]!=0) printf("%d%c",str1[j],j+65); } if(i!=0) printf("\n"); } } |
Double click to view unformatted code.