programming question about numbers

Posted by Syom on Stack Overflow See other posts from Stack Overflow or by Syom
Published on 2010-03-26T19:14:00Z Indexed on 2010/03/26 19:23 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

it's a task, on which i think during whole day. i have four integer numbers a, b, c, d, and ineger x[1,40].


i must write a program, which can find the values of {a,b,c,d}, for which one of following equations is true for any (x<=40, x>=1)

    x=a or
    x=b or
    x=a+b or
    x=a+b+c+d or
    x+a=c+d or
    x+a+b=c+d or
    ...
    x+a+b+c=d or ... 

it is very difficult to explain what i want to say. maybe the example will be helpful.

example:

if x=17, by {a=1,b=2,c=5,d=15} i can write x+a+b=c+d whole question is to present any x[1,40] by {a,b,c,d}. hope that you understand what i want to say, and thanks in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about c