przemko

Arytmetyka -- tablicowanie wyników

Jun 12th, 2017
7,783
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.32 KB | None | 0 0
  1. % fib.pl
  2.  
  3. :- dynamic fib/2.
  4.  
  5. fib(0, 0).
  6. fib(1, 1).
  7. fib(N, F) :-
  8.     N > 1,
  9.     N1 is N - 1,
  10.     N2 is N - 2,
  11.     fib(N1, F1),
  12.     fib(N2, F2),
  13.     F is F1 + F2,
  14.     asserta(fib(N, F)).
  15.  
  16. fib(0).
  17. fib(1).
  18. fib(X) :-
  19.     fib(0, 1, X).
  20.  
  21. fib(A, B, X) :-
  22.     S is A + B,
  23.     (   X = S
  24.     ;   fib(B, S, X)).
Advertisement
Comments
  • User was banned
  • Suikzau
    204 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • Zyubi
    200 days
    # text 0.19 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
  • User was banned
Add Comment
Please, Sign In to add comment