rubyx/stash/fibo_recursice.ruby
2014-05-22 19:34:13 +03:00

9 lines
176 B
Ruby

def fibonaccir( n , put )
return n if n <= 1
res = fibonaccir( n - 1 , put ) + fibonaccir( n - 2 , false )
puts(res) if put
res
end
fibonaccir( 10 , true)