hi, everyone, I have another problem now, a bit confused now.
Here is the code:
sumY(X1,[[X,Y]|Rest],Sum0,Sum) :-
X =:= X1,
Sum is Y+Sum0,
nl,write(Sum),write('##'),nl,
sumY(X1,Rest,Sum,Sum).
sumY(X1,[[X,Y]|Rest],Sum0,Sum) :-
X =\= X1,
Sum is Sum0,
nl,write(Sum0),write(' @...
Dear Everyone:
I am a new starter,and make a programme: here are the code:
matchsort([H|T],YList,XList,[N|M]) :-
nth1(Index,YList,H),
write('******'),nl,write(H),nl,
nth1(Index,XList,N),
write(N),nl,write('------'),nl,
matchsort(T,YList,XList,M).
matchsort([],[],[],[]).
run with...
hi, guys,
I meet a problem, I made a programme to generate a 'list'
?1?234?
?1?232?
?2?343?
?4?342?
...
I want to transfer this 'list' to a new list, as
[1,234],[1,232],[2,343],[4,342]...
how to realize this function?
thank you for your help, I am looking forward to your reply.
Many many many...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.