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