11 lines
224 B
Text
11 lines
224 B
Text
function fact(n int in) returns (bigint)
|
|
if (n < 0)
|
|
writestdout("No negative numbers");
|
|
return (0);
|
|
end
|
|
ans bigint = 1;
|
|
for (i int from 1 to n)
|
|
ans *= i;
|
|
end
|
|
return (ans);
|
|
end
|