mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
11 lines
78 B
Ruby
11 lines
78 B
Ruby
|
def fib n
|
||
|
if n < 3
|
||
|
1
|
||
|
else
|
||
|
fib(n-1) + fib(n-2)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
fib(34)
|
||
|
|