You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
225 B
16 lines
225 B
1 year ago
|
let
|
||
|
func factorial (n: Integer): Integer ~
|
||
|
if n <= 1
|
||
|
then 1
|
||
|
else n * factorial (n-1);
|
||
|
|
||
|
var i: Integer
|
||
|
|
||
|
in
|
||
|
begin
|
||
|
getint (var i);
|
||
|
putint (i); put ('!');
|
||
|
put (' '); put ('='); put (' ');
|
||
|
putint (factorial (i))
|
||
|
end
|