How to solve this arithmetic expression puzzle in Prolog?
问题 I have a programming problem (https://blog.svpino.com/2015/05/08/solution-to-problem-5-and-some-other-thoughts-about-this-type-of-questions): Write a program that outputs all possibilities to put + or - or nothing between the numbers 1, 2, ..., 9 (in this order) such that the result is always 100. E.g.: 1 + 2 + 34 – 5 + 67 – 8 + 9 = 100. I solved this problem with Python to get 11 answers : import itertools for operator in [p for p in itertools.product(['+','-',''], repeat=8)]: values = zip(