This repository has been archived on 2023-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
iaj/TP1/Prolog/AidesCPP/fac.pl

9 lines
100 B
Perl
Raw Permalink Normal View History

2023-02-01 10:10:53 +01:00
fac(1,1):- !.
fac(X,F):-
X > 1,
Y is X - 1,
fac( Y, Next ),
F is X * Next.
2023-02-01 10:19:02 +01:00
% ?- fac(3, X).