How to obtain the cost of each employee in Prolog?
问题 How would I be able to obtain the totalcost and loop through each employee to get the cost individually? Expected output: ?- make_team([batman, superman, aquaman], Heroes, TotalCost). Heroes = [[batman, bruce, wayne, 342000], [superman, clark, kent, 475000], [aquaman, arthur, curry, 5000]], TotalCost = 822000. % Returns a list of available heroes. % Each hero's information is also stored as a list. employees(E) :- E = [ [superman, clark, kent, 475000], [batman, bruce, wayne, 342000], [wonder