langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
10
Task/Anonymous-recursion/OCaml/anonymous-recursion-1.ocaml
Normal file
10
Task/Anonymous-recursion/OCaml/anonymous-recursion-1.ocaml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
let fib n =
|
||||
let rec real = function
|
||||
0 -> 1
|
||||
| 1 -> 1
|
||||
| n -> real (n-1) + real (n-2)
|
||||
in
|
||||
if n < 0 then
|
||||
None
|
||||
else
|
||||
Some (real n)
|
||||
Loading…
Add table
Add a link
Reference in a new issue