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

I help you:(
Posted by biksu 5 Oct 2010 23:49
I need help with code 1409:

#include <stdio.h>
int main()
{
    int a,b,c,d;
    scanf("%d%d",&a,&b);
    printf("%d\n",c=10-a,d=10-b, c+d<10);
    scanf("%d%d",&c,&d);
    getchar(), getchar();
    return 0;
}
Re: I help you:(
Posted by Moonstone [Samara SAU] 6 Oct 2010 00:32
You don't understand this problem.

Let Harry shooted A cans and Larry shooted B cans, then together they shooted A+B-1 cans.
So Harry didn't shoot (A+B-1)-A = B-1 cans, and Larry didn't shoot (A+B-1)-B = A-1 cans. And it's the answer!