I have tried and gotten most of it, I put a comment by the else "//must be a digit. Build a number." Where I need the help. Some notes:
There is a 100 word upper limit on the number of different words in the input file. The end of the input file is signified by the number 0 on a line by itself. The terminating 0 merely indicates the end of the input and should not be part of the output produced.
A word is defined to be a maximal sequence of upper- and lower-case letters. Words are case-sensitive - the word abc is not the same as the word Abc.