18 lines
479 B
Plaintext
18 lines
479 B
Plaintext
multifactorial = proc (n, degree: int) returns (int)
|
|
result: int := 1
|
|
for i: int in int$from_to_by(n, 1, -degree) do
|
|
result := result * i
|
|
end
|
|
return (result)
|
|
end multifactorial
|
|
|
|
start_up = proc ()
|
|
po: stream := stream$primary_output()
|
|
for n: int in int$from_to(1, 10) do
|
|
for d: int in int$from_to(1, 5) do
|
|
stream$putright(po, int$unparse(multifactorial(n,d)), 10)
|
|
end
|
|
stream$putc(po, '\n')
|
|
end
|
|
end start_up
|