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 1038. Spell Checker

Can I read input text "while not Eoln do"? PLEASE HELP!!!
Posted by Alex Stoff 7 Aug 2005 18:38
Please!
I wrote Spell Checker
...
While not Eoln do
Begin
  ... {I Check It}
End;

Why doesn't it work?
Who knows?

Edited by author 07.08.2005 18:47
Re: Can I read input text "while not Eoln do"? PLEASE HELP!!!
Posted by Evil Cheater 7 Aug 2005 20:50
Hi!

Try using "While (not eof(input)) do".
It doesn't work!
Posted by Alex Stoff 7 Aug 2005 21:21
Hello!
Thank you, but it doesn't work!
Re: It doesn't work!
Posted by Evil Cheater 9 Aug 2005 22:28
Hi!

  My program looks something like this (and it works, I just send it again to be sure):

Var
   ch: char;
   p: boolean;
   e,c: Longint;

Begin
     p:= true; e:= 0; c:= 0;
     While (not eof(input)) do
           begin
           read(input,ch);
           if (valid_expression) then do_something;
           if (valid_expression) then do_something;
           if (valid_expression) then do_something;
           if (valid_expression) then do_something
                                 else do_something_else;
           if (valid_expression) then do_something;
           end;
     writeln(output,e);
End.

  Just change "valid_expression", "do_something" and "do_something_else" for the apropiate code.

Edited by author 09.08.2005 22:32
Re: It doesn't work!
Posted by Vladimir Yakovlev (USU) 9 Aug 2005 23:01
Try SeekEof(stdin)
Re: Can I read input text "while not Eoln do"? PLEASE HELP!!!
Posted by Igor 10 Aug 2005 02:56
while not EOF do
begin
read(n);
....
....
....
end;
Alex Stoff wrote 7 August 2005 18:38
Please!
I wrote Spell Checker
...
While not Eoln do
Begin
  ... {I Check It}
End;

Why doesn't it work?
Who knows?

Edited by author 07.08.2005 18:47
Re: Can I read input text "while not Eoln do"? PLEASE HELP!!!
Posted by Igor 10 Aug 2005 02:56
while not EOF do
begin
read(n);
....
....
....
end;
Thanks
Posted by Alex Stoff 10 Aug 2005 14:23
Thank you.
I'll try it