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

Help!
Posted by Evil Cheater 15 Nov 2002 22:29
  What's wrong with this program? (Any help aprecciated)

Var
   ch: char;
   i,n: integer;
   a: array [1..255] of char;

Begin
      n:= 0;
      Repeat
            read(ch);
            if (ch in ['a'..'z']) or
               (ch in ['A'..'Z']) then begin
                                       Inc(n);
                                       a[n]:= ch;
                                       end
                                  else begin
                                       for n:= n downto 1 do
                                           write(a[n]);
                                       n:= 0;
                                       write(ch);
                                       end;
            until (eof);
End.
Re: Help!
Posted by Илья Гофман (Ilya Gofman) 16 Nov 2002 19:49
It's difficult to say. There were some problems about this problem,
because many people solved during the online contest?  and then
recieved an e-mail where i8t was written that it was a mistake, and
it's WA.
Re: Help!
Posted by JL Wang 18 Nov 2002 19:13
>   What's wrong with this program? (Any help aprecciated)
>
> Var
>    ch: char;
>    i,n: integer;
>    a: array [1..255] of char;
>
> Begin
>       n:= 0;
>       Repeat
>             read(ch);
>             if (ch in ['a'..'z']) or
>                (ch in ['A'..'Z']) then begin
>                                        Inc(n);
>                                        a[n]:= ch;
>                                        end
>                                   else begin

>                                        for n:= n downto 1 do
>                                            write(a[n]);
>                                        n:= 0;
>                                        write(ch);
>                                        end;
>             until (eof);
> End.
When you press key "Enter" it contains two symbol, but you cna only
read one.
Thanks!, but...
Posted by Evil Cheater 20 Nov 2002 07:44
Thanks for the help!

  How can I fix that problem?