标签: list prolog
我有两个列表,例如:
L1=[1,0,1,0,1,1] L2=[2,3,4,2,1,1]
我想查看这样的内容
if (L1[k]==0) sum=L2(k)
使用prolog有没有办法做到这一点?
答案 0 :(得分:1)
nth0(Ind, Lst, Elem) enables random access to the list elements under SWI-Prolog