ruby--ruby/benchmark/other-lang/fib.scm

8 lines
105 B
Scheme

(define (fib n)
(if (< n 3)
1
(+ (fib (- n 1)) (fib (- n 2)))))
(fib 34)