ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
back to board

Discussion of Problem 1214. Strange Procedure

smth wrong:
Posted by looser 7 Aug 2004 12:59
i have this code:
    long x, y;
    if( (x + y) % 2 == 0 )
        printf("%ld %ld", x, y);
        printf("%ld %ld", y, x);
and i don't check that x is > 0 and y > 0. Because "Input contains <...> output parameters of the function". so they are greater than 0! Can you explain me what is wrong?
Re: smth wrong:
Posted by Seyyed Mehran Kholdi 24 Jun 2008 01:24
Examine the code again. if x<=0 || y<=0, value of x and y won't change. Maybe you should mention that the function never returns any value. you must output the input parameters based on the value of x and y in the last line of the function.