如何编写prolog程序将列表分成两个列表 [英] How to write a prolog progrm for dividing a list into two list
本文介绍了如何编写prolog程序将列表分成两个列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出一个名为dividelist(List,List1,List2)的关系的定义,以便List的元素在List1和List2之间分区。
例如 - dividelist ([a,b,c,d,e],[a,c,e],[b,d])
Give the definition of a relation called dividelist(List,List1,List2)so that the elements of List are partitioned between List1 and List2.
e.g - dividelist( [a,b,c,d,e], [a,c,e], [b,d])
推荐答案
这篇关于如何编写prolog程序将列表分成两个列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文