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 1226. esreveR redrO

Why I got WA???
Posted by Oskar Wantola 24 gymnasium 3 Mar 2003 19:27
var
s,sd:string;
i:integer;
begin
while not (eof) do begin
readln(s);
sd:='';
for i:=1 to length(s) do
if s[i]in['A'..'z'] then sd:=s[i]+sd
else begin write(sd);write(s[i]);sd:='' end;
if s[i] in ['A'..'z']then write(sd);
writeln
end
end.
Re: Why I got WA???
Posted by Pooya 7 Mar 2003 17:59
Hi
I think the misteke is :

*****if s[i]in['A'..'z'] then sd:=s[i]+sd
should be
*****if (s[i]in['A'..'Z']) or (s[i]in['a'..'z']) then sd:=s[i]+sd

and in the line 11 the mistake is the same.

yours
pooya
email: pooyahat@yahoo.com

in the
> var
> s,sd:string;
> i:integer;
> begin
> while not (eof) do begin
> readln(s);
> sd:='';
> for i:=1 to length(s) do
> if s[i]in['A'..'z'] then sd:=s[i]+sd{********}
> else begin write(sd);write(s[i]);sd:='' end;
> if s[i] in ['A'..'z']then write(sd);
> writeln
> end
> end.