strange012

Untitled

Dec 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.22 KB | None | 0 0
  1. split(_,[],[],[]) :- !.
  2.  
  3. split(A,[H|L],X,[H|Y]) :-
  4.     A<H, !, split(A, L, X,Y).
  5.  
  6. split(A,[H|L],[H|X],Y) :-
  7.     split(A, L, X,Y).
  8.  
  9.  
  10. pairadd([_|[]], []) :- !.
  11. pairadd([A,B|L], [H|X]) :- H is A+B, pairadd([B|L], X).
Add Comment
Please, Sign In to add comment