C
C
claus_bor2017-09-04 19:07:54
Java
claus_bor, 2017-09-04 19:07:54

How to find all addition options for the number 610 in java?

You need to find all the options for adding the number 610 using numbers only from 1 to 6.
Using the number 4 as an example:
1) 4
2) 1 + 3
3) 2 + 2
Help with the formula or, if not difficult, immediately in java with the code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-09-04
@red-barbarian

head-on solution
6*a+5*b+4*c+3*d+2*e +++ the remaining ones (h)
run through the cycles a, b, c, d, e until the sum is less than or equal to a number.
during the loops, we calculate the number h and print the answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question