lama_byterun/regression/test028.expr

16 lines
189 B
Text
Raw Normal View History

2018-03-27 01:51:22 +03:00
fun fact (n) {
if n <= 1
then result := 1
else
fact (n-1);
result := result * n
fi
}
read (n);
for i := n, i >= 1, i := i-1 do
fact (i);
write (i);
write (result)
od