Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
19
Task/Factorial/PascalABC.NET/factorial.pas
Normal file
19
Task/Factorial/PascalABC.NET/factorial.pas
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
function FactIter(n: integer): BigInteger;
|
||||
begin
|
||||
Result := 1;
|
||||
for var i:=2 to n do
|
||||
Result *= i;
|
||||
end;
|
||||
|
||||
function FactRec(n: integer): BigInteger;
|
||||
begin
|
||||
if n = 0 then
|
||||
Result := 1
|
||||
else Result := n * FactRec(n - 1);
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
for var i:=1 to 20 do
|
||||
Println(i,FactRec(i),FactIter(i));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue