View Code of Problem 36

# include<stdio.h>
# include<string.h>
int main(void)
{
  int t,i,len,j;
  char a[1000];
  scanf("%d",&t);
  for(i=0;i<t;++i)
  {
    int b[100]={0};
    scanf("%s",a);
    len = strlen(a);
    for(j=0;j<len;++j)
    {
      b[a[j]-64]++;
    }
    for(j=1;j<27;++j)
    {
        if(b[j]==0)
        {
            continue;
        }
        else
        printf("%d%c",b[j],j+64);
    }
    printf("\n");
  }
  return 0;
}

Double click to view unformatted code.


Back to problem 36