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

I don't know why I got ac.
Posted by 衣衣是我的全部,我爱衣衣 14 Nov 2005 05:03
I have writen the program if many similar ways. I don't know why I got ac with this program:
const u : set of char = ['A'..'Z','a'..'z'];
var
  s   : string;
  i   : integer;
  ch  : char;
begin
  s := '';
  while not (eof) do
    begin
      read(ch);
      if ch in u then s := ch+s
                 else begin
                        write(s);
                        write(ch);
                        s := '';
                      end;
    end;
  if ch in u then write(s);
end.
Re: I don't know why I got ac.
Posted by Growing of my heart…… 14 Nov 2005 05:05
by the way, the pascal program should use "read(char)" instead  "readln(string)" or you will get crash!
Re: I don't know why I got ac.
Posted by wyyyl 10 Aug 2006 16:30
Yeah, I don't know, either.
I think it sure will be WA.
Re: I don't know why I got ac.
Posted by RASTA 17 Apr 2009 23:12
may be all the words are palindromes:)
Re: I don't know why I got ac.
Posted by →MOPDOBOPOT← 9 Nov 2009 19:20
All right. Because s +'abc' will give "sabc", and 'abc' + s will give "abcs".