View Code of Problem 36

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int i,j;
    char b[100];
    scanf("%d",&j);
    getchar();
    while(j!=0)
    {
     int a[100]={0};
    gets(b);
    for(i=0;i<strlen(b);i++)
    {
        a[b[i]]++;
    }
    for(i=65;i<=90;i++)
    {
        if(a[i]!=0)
        {
            printf("%d%c",a[i],i);
        }
    }
    printf("\n");
    j--;
    }

    return 0;
}

Double click to view unformatted code.


Back to problem 36