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

Common Board

What's wrong?(1214)
Posted by APS 18 Aug 2004 15:46
I have wrong on test #10 What's wrong????
{$A+,B-,D+,E+,F-,G-,I+,L+,N+,O-,P-,Q-,R-,S+,T-,V+,X+,Y+}
{$M 16384,0,655360}

program gsd;
var
x,y:longint;
sum:extended;
begin
  x:=-1;y:=-1;
  while not eoln  do
          read(x,y);
  sum:=x+y;
  if ((sum)<0)and(x>0)and(y>0) then write(x,' ',y) else
  if (x>0)and(y>0) then
     begin
       if ((x mod 2)=0)and((y mod 2)=0)or((x mod 2)=1)and((y mod 2)=1) then
         write(x,' ',y) else write(y,' ',x);
     end else write(x,' ',y);
end.
Re: What's wrong?(1214)
Posted by Macarie 18 Aug 2004 19:21
this is my code...

#include <stdio.h>

long x, y;

void main()
{
    long myx, myy;
    scanf("%ld %ld", &x, &y);
    if ((x + y) % 2 && x > 0 && y > 0) myx = y, myy = x; else myx = x, myy = y;
    printf("%ld %ld", myx, myy);
}