ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1603. Erudite

Please tell me what is wrong with my read function (WA3)
Posted by Mihail Minkov 9 Apr 2008 04:16
First it was:
scanf("%s",&search);

Then:
scanf("%s",&search);
while(search[0]=='\n')
     scanf("%s",&search);

Now I changed it to:
gets(search);
while(search[0]=='\0'||search[0]=='\n')
    gets(search);

None of those work and I know that I'm missing something with the line breaks, but I don't know what.
Re: Please tell me what is wrong with my read function (WA3)
Posted by KIRILL(ArcSTUpid coder:) 9 Apr 2008 16:26
for what purpose you use such input
maybe better
for(;n;n--) gets(s);