pares([], []).
pares
([X
|Xs
], L
) :- X
mod 2 =:= 0, pares
(Xs
, Laux
), append
([X
], Laux
, L
).pares
([X
|Xs
], L
) :- X
mod 2 =\
= 0, pares
(Xs
, Laux
), L
= Laux
.
?- pares
([1,2,3,4], L
), write(L
).
cGFyZXMoW10sIFtdKS4KcGFyZXMoW1h8WHNdLCBMKSA6LSBYIG1vZCAyID06PSAwLCBwYXJlcyhYcywgTGF1eCksIGFwcGVuZChbWF0sIExhdXgsIEwpLgpwYXJlcyhbWHxYc10sIEwpIDotIFggbW9kIDIgPVw9IDAsIHBhcmVzKFhzLCBMYXV4KSwgTCA9IExhdXguCgo/LSBwYXJlcyhbMSwyLDMsNF0sIEwpLCB3cml0ZShMKS4=