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 1214. Strange Procedure

Whi wrang it avresing good in it . i chack it by given procedure and all tests is good. help please
Posted by I am david. Tabo. 23 Oct 2002 23:57
var x,y:longint;
 begin
   readln(x,y);
   if x=y then
     begin
       writeln(x,' ',y);halt;
     end;
  if ((x mod 2= 0)and(y mod 2 = 0))or((x mod 2<>0)and(y mod 2<>0))
then
    begin
      writeln(x,' ',y);halt;
    end;
  writeln(y,' ',x);
end.
I see that you not check x>0 and y>0. Try negative numbers.
Posted by Algorithmus_UA(algorithmus@univ.kiev.ua) 24 Oct 2002 02:30
> var x,y:longint;
>  begin
>    readln(x,y);
>    if x=y then
>      begin
>        writeln(x,' ',y);halt;
>      end;
>   if ((x mod 2= 0)and(y mod 2 = 0))or((x mod 2<>0)and(y mod 2<>0))
> then
>     begin
>       writeln(x,' ',y);halt;
>     end;
>   writeln(y,' ',x);
> end.
Oh i forgot it
Posted by I am david. Tabo. 24 Oct 2002 17:13