Advertisement
Guest User

Untitled

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