by Monty » Mon Feb 27, 2012 2:50 am
The reason for that is because your input does not include a trailing new line. You need that in order to see if you are done with the input or typing a new line. Since we don't know how many lines there are for each input, I wait for the user to send a blank new line before terminating. Without that how else would you know? I wish it included the number of lines for each test case in it, that would simplify things. The input you tried didn't include that. The runtime error the website says is due to the system.exit I believe, because it still produces the proper output. Thanks
Edit: One of the things I just noticed was that I was trimming the input lines so I was losing leading spaces in the output. Even after fixing that I am still getting WA, hmm.