Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Factorial/CLU/factorial.clu
Normal file
15
Task/Factorial/CLU/factorial.clu
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
factorial = proc (n: int) returns (int) signals (negative)
|
||||
if n<0 then signal negative
|
||||
elseif n=0 then return(1)
|
||||
else return(n * factorial(n-1))
|
||||
end
|
||||
end factorial
|
||||
|
||||
start_up = proc ()
|
||||
po: stream := stream$primary_output()
|
||||
|
||||
for i: int in int$from_to(0, 10) do
|
||||
fac: int := factorial(i)
|
||||
stream$putl(po, int$unparse(i) || "! = " || int$unparse(fac))
|
||||
end
|
||||
end start_up
|
||||
Loading…
Add table
Add a link
Reference in a new issue