能帮我处理下三个Prolog方案吗?
Summary of the elements in a list, and check that is divided or not divided with 3? For example, the list is [1, 2, 3] --> and the sum of the element is divided with 3, because 1+2+3=6, and 6/3=2 --> so the output should be true.
如果7是列表中的,则加倍。 例如:输入列表 - & gt; [1, 7, 3, 7, 7,7], 产出应该是 [1, 7, 7, 7, 7,7,7] 。
如果7是列表中的7, 请更改为 2, 7 2. 例如: 输入列表 - & gt; [1, 7, 2, 1], 输出应该是 [1, 2, 7, 7, 2, 2, 1] em]
程序是什么? 如何用 SWI -Prolog 测试?
感谢大家的期待!