Problem Description: For some reason, your school's football team has chosen to spell out the numbers on their jerseys instead of using the usual digits. Being great fans, you're going to be ready to cheer for your favorite players by bringing letter cards so you can spell out their number. Each fan has different favorites, so they each need to bring different sets of letters. The English spellings for the numbers 0 to 12 are: ZERO ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN ELEVEN TWELVE Input Format: Read a set of integers from 0 to 12, separated by spaces, representing one fan's favorite players. The last integer will be 999, marking the end of the line.
C Program


#include<stdio.h>

char nums[13][256] = {

"ZERO","ONE","TWO","THREE","FOUR","FIVE",

"SIX","SEVEN","EIGHT","NINE","TEN","ELEVEN","TWELVE"

};

int main()

{

    int x;

    int freq[26]={0};

    int n;

    while(1)

    {

        scanf("%d",&x);

        if(x==999)

        {

            printf("0999");

            break;

        }

        printf("%d ",x);

        if(x>=0 && x<=12)

        {

            int i=0;

            while(nums[x][i]!='\0')

            {

                freq[nums[x][i]-'A']++;

                i++;

            }

        }

    }

    printf(". ");

    for(n=0;n<26;n++)

    {

        while(freq[n]--)

            printf("%c ",'A'+n);

    }

    return 0;

}