mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
18 lines
No EOL
214 B
Text
18 lines
No EOL
214 B
Text
local n, i, result;
|
|
|
|
fun fact (n) {
|
|
if n <= 1
|
|
then result := 1
|
|
else
|
|
fact (n-1);
|
|
result := result * n
|
|
fi
|
|
}
|
|
|
|
n := read ();
|
|
|
|
for i := n, i >= 1, i := i-1 do
|
|
fact (i);
|
|
write (i);
|
|
write (result)
|
|
od |