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

The problem is generally very simple but in pascal(i don't know if in C also) the problem is to read input corectly can anyone help me please ?
Posted by Mateusz Linda 9 Sep 2002 00:57
The problem is  generally very simple but in pascal(i don't know if
in C also) the problem is to read input corectly :(((( I 've tried
methods with eof and eoln but theyb seem to don't work can anyone
tell me how can i read inpuit in my program (below) please ....
(bledy=mistakes, zdanienowe= new sentence, nowywyraz= new word)
var
m:string[200];
d,i,c,z:byte;
bledy:longint;
zdanienowe,nowywyraz:byte;
procedure sprawdz;

begin
d:=length(m);
i:=0;
                while i<d do
                begin
                inc(i);
                if (ord(m[i])=46)or(ord(m[i])=33)or(ord(m[i])=63)
then zdanienowe:=1
                else  if (ord(m[i])=0)or(ord(m[i])=32) then
                         begin
                         nowywyraz:=1;
                         c:=1
                      end
                else if (ord(m[i])>63)and(ord(m[i])<91)or(ord(m[i])
<123)and(ord(m[i])>96)then

                begin

                  if (zdanienowe=1) then
                  begin
                  if (ord(m[i])<123)and(ord(m[i])>96) then inc(bledy);
                  zdanienowe:=0;
                  end
                  else if nowywyraz=1 then
                  begin
                  nowywyraz:=0;
                  c:=0
                  end
                  else if (ord(m[i])>63)and(ord(m[i])<91) then inc
(bledy);
                  end;
               if c=0 then nowywyraz:=0;
               end;
end;
begin
zdanienowe:=1;
readln(m);

while m<>''do
begin
nowywyraz:=1;
if m<>'' then sprawdz;
readln(m);
end;
writeln(bledy);
end.
Re: The problem is generally very simple but in pascal(i don't know if in C also) the problem is to read input corectly can anyone help me please ?
Posted by Locomotive 19 Dec 2002 14:59
Are you have still Problem?