Hmm, that is weird. I had only 1 line break in each loop. Oh well, I'm glad that I checked and know I have the algorithm correct(the issue with the 5th test case was just a small fault on not updating some code for the first word decoded.
Good thing that was warm up. Can't have a day like that once we get to ECOO and CCC.
Thanks for the replies, I will look at my code again later and see if i forgot to take out an extra line break or something, but don't think i did.
Tony @ Wed Oct 26, 2011 7:38 pm wrote:
the output suggests that \r\n newlines are not handled properly. If getline grabs just the first separator, the second one will be left in the buffer, which would produce blank lines on the following reads.
Seems that might have been my issue. getline() probably doesn't handle those as it should. Still should have got 1/5 for the first case though...
Thanks for those test cases for #5 Cyril, I quite enjoyed reading them. I keep realizing other blunders I made and am pretty pissed at my stupidity (getchar() in a solution still...)