Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- groesser([], [], 0).
- groesser([A|As], [B|Bs], X) :- greater_than_list([A], [B|Bs], 0), X is X + 1, print(X), nl, groesser(As, B, X).
- greater_than_list(A, [B|Bs], Check).
- greater_than_list(A, [B|Bs], Check) :- A>B, Check is Check + 1, greater_than_list(A, Bs).
- greater_than_list(A, [B|Bs], Check) :- A=\=B, greater_than_list(A, Bs).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement