Prolog problems

I have two problems that need to be solved. Please help

Tags: No tags