Converting minutes to hours in prolog
问题 I am trying to convert total minutes(N) to number of hours(H) and number of minutes(M) in prolog using this code (Have not implemented counting the minutes yet): minutes_to_hours(N, H, M) :- ( N >= 60 -> H is H1+1, N is N1-60, minutes_to_hours(N, H, M) ; writeln(H) ). I get this error: Arguments are not sufficiently instantiated In: [2] _1440 is _1446+1 [1] mins_to_hours_and_mins(60,_1508,_1510) at line 1 回答1: As you requested, a possible solution using recursion could be: minutes_to_hours