rubyx/test/runners/fibo_recursice.ruby
2014-04-29 17:14:26 +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)