Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Catalan-numbers/CLU/catalan-numbers.clu
Normal file
14
Task/Catalan-numbers/CLU/catalan-numbers.clu
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
catalan = iter (amount: int) yields (int)
|
||||
c: int := 1
|
||||
for n: int in int$from_to(1, amount) do
|
||||
yield(c)
|
||||
c := (4*n-2)*c/(n+1)
|
||||
end
|
||||
end catalan
|
||||
|
||||
start_up = proc ()
|
||||
po: stream := stream$primary_output()
|
||||
for n: int in catalan(15) do
|
||||
stream$putl(po, int$unparse(n))
|
||||
end
|
||||
end start_up
|
||||
Loading…
Add table
Add a link
Reference in a new issue