Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- silnia(0,1).
- silnia(N,Y) :- N>0, N1 is N-1, silnia(N1,Y1), Y is Y1 * N.
- pow(_,0,1).
- pow(M,N,Y) :- N>0, N1 is N-1, pow(M,N1,Y1), Y is Y1 * M.
- elem(E,[E|_]).
- elem(E,[_|O] :- elem(E,O)).
- lel1([],0).
- lel1([_|O], N) :- lel1(O,N1), N is N1 + 1.
- lel2(L,N) :- pom(L,0,N).
- pom([],N,N).
- pom([_|O],N1,N) :- N2 is N1 + 1, pom(O,N2,N).
- pp(X,Y,Z) :- p(X), p(Y), p(Z).
- pp(aa,bb,cc) :- p(c).
- p(a) :- fail.
- p(b) :- !.
- p(c).
- p(d).
- perm([],[]).
- perm(L2,[G|O]) :- usun(G,L2,L), perm(L,O).
- usun(E,[E|O],O).
- usun(E,[G|O],[G|O1]) :- usun(E,O,O1).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement