17 lines
201 B
Ruby
17 lines
201 B
Ruby
|
class Space
|
||
|
|
||
|
def fibo_r( n )
|
||
|
if( n < 2 )
|
||
|
return n
|
||
|
else
|
||
|
a = fibo_r(n - 1)
|
||
|
b = fibo_r(n - 2)
|
||
|
return a + b
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def main(arg)
|
||
|
return fibo_r(5)
|
||
|
end
|
||
|
end
|