aboutsummaryrefslogtreecommitdiff
path: root/entries/komodoooo/fib.cr
blob: f15ca3b029b0cbbcfa08bda4097fa5f677006508 (plain) (blame)
1
2
3
4
5
6
7
8
9
def fibonacci(n)
    a,b=0,1
    while a < n
        puts "#{a} "
        a,b=b,a+b
    end
end
print "Number: "
fibonacci(gets.not_nil!.to_i)