#include<bits/stdc++.h> using namespace std; int main() { int t; scanf("%d",&t); char s[1001]; while(t--){ scanf("%s",s); int count[10001]={0}; for(int i=0;i<strlen(s);i++){ count[s[i]]++; } for(int j='A';j<='Z';j++){ if(count[j]!=0)printf("%d%c",count[j],j); } printf("\n"); } return 0 ; } |
Double click to view unformatted code.