Not sure but could be the last 'endl' for the last line you intentionally avoided. Note that UVa reports WA on mis-formatting, instead of PE (long ago since host migration).
The while loop judging cin.eof() could also fail it if the input file has extra lines that although the test cases are read but in the tail there are some blanks, cin.eof() is true and you are still running and the output could be corrupted. It's safer to use just: while (cin >> str1 >> str2) { .. } The code logic looks fine to me (hard to tell though, UVa is lining up judging queue for now.) Regards On Thu, Dec 13, 2012 at 11:55 AM, thefourtheye dIVi < thechargingvolc...@gmail.com> wrote: > Hi, > > I believe it is a very simple problem but still getting WA... :( > > Could you anyone please help me spotting the mistake? > > http://ideone.com/dAsYdK > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To post to this group, send email to google-code@googlegroups.com. > To unsubscribe from this group, send email to > google-code+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 8-) -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To post to this group, send email to google-code@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.