mirror of
https://github.com/heqin-zhu/algorithm.git
synced 2024-03-22 13:30:46 +08:00
13 lines
139 B
Plaintext
13 lines
139 B
Plaintext
|
func f(n)
|
||
|
begin
|
||
|
if n=1 then return 1;
|
||
|
return n*f(n-1);
|
||
|
end;
|
||
|
|
||
|
var a;
|
||
|
begin
|
||
|
a:=f(10);
|
||
|
print('factorial 10 is %d',a);
|
||
|
end
|
||
|
.
|