Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- items([item(fork,20,2),
- item(spoon,50,5),
- item(knife,100,3),
- item(table,10,100)]).
- firma(_,[],[]).
- firma(N,[item(N,S,V)|T],[S,V|T1]):- write(S*V),firma(N,T,T1).
- firma(N,[H|T],T1):-firma(N,T,T1).
- ?-write(" write item "),nl,read(N),items(L),write("The price of all "),
- write(N),write("s is: " ),firma(N,L,L1),nl.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement