September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153127 additions and 63862 deletions
|
|
@ -1,19 +0,0 @@
|
|||
class
|
||||
CATALAN_NUMBERS
|
||||
feature
|
||||
|
||||
cat_num(n:INTEGER): DOUBLE
|
||||
require
|
||||
n_not_negative:n>= 0
|
||||
local
|
||||
s,t: DOUBLE
|
||||
do
|
||||
if n=0 then
|
||||
Result:= 1.0
|
||||
else
|
||||
t:= 4*n.to_double-2
|
||||
s:= n.to_double+1
|
||||
Result:= t/s*cat_num(n-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
class
|
||||
APPLICATION
|
||||
inherit
|
||||
ARGUMENTS
|
||||
create
|
||||
make
|
||||
feature {NONE} -- Initialization
|
||||
make
|
||||
local
|
||||
s: STRING
|
||||
do
|
||||
create cat
|
||||
from
|
||||
i:=0
|
||||
until
|
||||
i>14
|
||||
loop
|
||||
io.put_double (cat.cat_num (i))
|
||||
io.put_string ("%N")
|
||||
i:= i+1
|
||||
end
|
||||
end
|
||||
cat: CATALAN_NUMBERS
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue