Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. groesser([], [], 0).
  2. groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs]), X is X + 1, print(X), nl, groesser(As, B, X).
  3. groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs]), print(X), nl, groesser(As, B, X).
  4.  
  5. greater_than_list(A, [B|Bs]).
  6. greater_than_list(A, [B|Bs]) :- A>B, greater_than_list(A, Bs).
  7. greater_than_list(A, [B|Bs]) :- A=\=B, greater_than_list(A, Bs).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement