Thats my task: We have coins: 1 cent, 2 cents, 5 cents, 10 cents, 20 cents, 50 cents, 1 dollar and 2 dollars. How many ways can you get 2 dollars using anynumber of coins?
I accualy ended up with something like this:
coins(a,1; b,2; c,5; d,10; e,20; f,50; g,100; h,200).
#const goal=200.
{selected(I)} :- coins(I, W).
:- #sum {W, X : coins(X, W), selected(X)} != goal.
#show selected/1.
How to show all the answers and let the program sums the same coins?? I'm brand new to that thing...