10 lines
146 B
Prolog
10 lines
146 B
Prolog
fac(0,1).
|
|
fac(1,1).
|
|
fac(2,2).
|
|
fac(3,6).
|
|
fac(4,24).
|
|
fac(A,B) :-
|
|
A > 0,
|
|
C is A-1,
|
|
fac(C,D),
|
|
B is A*D. |