Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. silnia(0,1).
  2. silnia(N,Y) :- N>0, N1 is N-1, silnia(N1,Y1), Y is Y1 * N.
  3.  
  4. pow(_,0,1).
  5. pow(M,N,Y) :- N>0, N1 is N-1, pow(M,N1,Y1), Y is Y1 * M.
  6.  
  7. elem(E,[E|_]).
  8. elem(E,[_|O] :- elem(E,O)).
  9.  
  10. lel1([],0).
  11. lel1([_|O], N) :- lel1(O,N1), N is N1 + 1.
  12.  
  13. lel2(L,N) :- pom(L,0,N).
  14. pom([],N,N).
  15. pom([_|O],N1,N) :- N2 is N1 + 1, pom(O,N2,N).
  16.  
  17. pp(X,Y,Z) :- p(X), p(Y), p(Z).
  18. pp(aa,bb,cc) :- p(c).
  19. p(a) :- fail.
  20. p(b) :- !.
  21. p(c).
  22. p(d).
  23.  
  24.  
  25. perm([],[]).
  26. perm(L2,[G|O]) :- usun(G,L2,L), perm(L,O).
  27. usun(E,[E|O],O).
  28. usun(E,[G|O],[G|O1]) :- usun(E,O,O1).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement