All about problems in Volume CXII. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
brianfry713 wrote:I did some slight modifications to your code and got AC. Instead of using getchar() and counting on that being a newline, try using while(getchar()!='\n');
That way your code will work if there are trailing whitespaces or DOS style newlines.
i got AC. but why was the problem occurring ? do they deliberately insert white spaces in the input? can u explain a bit more plz?
Do or do not. There is no try.
- Learning poster
- Posts: 69
- Joined: Wed Oct 19, 2011 9:06 pm
They might add extra spaces and on this problem it seems they did. Make your code handle it in case they do. Always read the problem statement carefully.
- Posts: 1751
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Return to Volume CXII
Who is online
Users browsing this forum: No registered users and 1 guest