Hello,
I am quite new to prolog and need to write this program, but have no ideas. I would be very grateful for any help.
"Add signs"
The list of the digits (1-9) is given. You need to add operation signs (+, -), that expression of the arithmetic would be the given number (digits in a row makes the number)
add_signs([1,2,3,4,5,6,7,8,9], 4, result).
result is 12-3+45-67+8-9 = 4
Thank you in advance!
I am quite new to prolog and need to write this program, but have no ideas. I would be very grateful for any help.
"Add signs"
The list of the digits (1-9) is given. You need to add operation signs (+, -), that expression of the arithmetic would be the given number (digits in a row makes the number)
add_signs([1,2,3,4,5,6,7,8,9], 4, result).
result is 12-3+45-67+8-9 = 4
Thank you in advance!