주어진 숫자로 프롤로그 계승을 만들려면 어떻게해야합니까?계승 (계승) 프롤로그에서 주어진 숫자로
run:-write('This is a Prolog program that find the factorial of a number'),
start.
start:- nl,nl,write('Please enter the number X = '),read(X),
enterd(X).
enterd(0):-
write('The factorial of a 0 is '),write('1'),nl.
enterd(X):-
X1 is X-1,
entered(X1,S),
R is S*X,
write('The factorial of the number is'),write(R),nl.
참조 [이 답변] (http://stackoverflow.com/a/2909528/772868) – false