#include<bits/stdc++.h> using namespace std; int main(){ char tmp[1000]; int n; scanf("%d",&n); while(n--){ int hao[100] = { }; gets(tmp); int len = strlen(tmp); for(int i = 0;i<len;i++)hao[tmp[i]]++; for(int i = 65;i <= 91;i++){ if(hao[i] != 0)cout<<hao[i]<<(char)i; } cout<<endl; } return 0; } |
Double click to view unformatted code.