11946 - Code Number
Moderator: Board moderators
Re: 11946 - Code Number
It can be a reason. I guess I need to use while(gets(s)); instead of gets(s);. But if so it will take unlimited inputs for first case. It never ends to the last case. I tried uDebug. There's no way to end the inputs for each single cases I think. Am I wrong, sir?
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11946 - Code Number
gets(s) will only return NULL/0 at the end of the input of the last test case. You can see if s is a blank string (s[0] == '\0') to detect the end of each test case except the last one.
Check input and AC output for thousands of problems on uDebug!
Re: 11946 - Code Number
Thank You So much! I got AC. . . . I wonder it's hard to solve thy one problem. Then how it will be to solve all's problem. And it's hard to seek bug from other's code. You are great!
Can you help me saying the way to delete or edit post here?
Can you help me saying the way to delete or edit post here?
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11946 - Code Number
If you are logged in you should see an edit box and an X above your posts.
Check input and AC output for thousands of problems on uDebug!
Re: 11946 - Code Number
Thanks. . . I got it. . . I couldn't find it while using from my mobile browser. . . . . ![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)