回複:有沒有好辦法?

來源: 2012-01-01 13:54:31 [舊帖] [給我悄悄話] 本文已被閱讀:

to get the number of answer. it similar to get:

±10 ±20 ±30 ±40 ±50 ±60 ±70 = ±80 

to simplify. we are doing this first:

±1±2±3±4±5±6±7=8

There will be 1 group with positive, the other group with negative.

sum of (1 to 7) is 28. and the difference of two groups is 8.

so x+y=28  and x-y =8.  

X=18 and Y=10.

To simplify, we only need to consider the sum equal to 10, the combinations are:

(1,2,3,4), (1,2,7),(1,3,6),(1,4,5),(2,3,5),(3,7),(4,6)

so 7 possiblities for the answer of 8, same thing, 7 possibility for the answer of -8. So there are 14 possible solutions.