Well, it's my personal opinion, but I don't like the idea of people just dumping their code on the board and expect others to do the debugging for them. I got lots of WA's myself and have my hands full debugging my own code. One way to get useful advise, is to tell people what you've already considered yourself, where you think the tricky parts of the input are, etc. But, again, that's my opinion.
You get an "Invalid Memory Reference" which almost always means that your array(s) are too small. I changed the array size from 100000 to 1000000 in your code, submitted it, and got "Wrong Answer". This means the array size is correct now (probably a bit too large, but who cares), but the output it produced is incorrect.
The problem description defines a word as a sequence of consecutive letters, and also tells you to leave the non-words alone. I tried the following input to your program:
Code: Select all
fourteen (14) little mice whent up 1 clock *&^&*
(there are three spaces at the end of the sentence!) and it produced:
Code: Select all
ourteenfay 14)(ay ittlelay icemay hentway upay 1ay lockcay &^&**ay ay ay y
Compare this to the output of my accepted program:
Code: Select all
ourteenfay (14) ittlelay icemay hentway upay 1 lockcay *&^&*
(there are still 3 spaces at the end).
Happy hunting!
-little joey