#include "stdio.h" #include "math.h" #include "string.h" int main() { int i,j,k; int t; char s[1001]; scanf("%d",&t); for(i=0;i<t;i++) { int a[100]={0}; fflush(stdin); gets(s); for(j=0;s[j]!='\0';j++) { a[s[j]-'0']++; } for(j=0;j<100;j++) { if(a[j]!=0) printf("%d%c",a[j],j+'0'); } printf("\n"); } return 0; } |
Double click to view unformatted code.