eval.in

Paste #883001

Racket — Racket 6.10.1, pasted 1 month ago (json)

1
2
3
4
5
6
7
8
9
#lang racket

(define (fib n)
  (let loop ([n n] [a 0] [b 1])
    (if (zero? n)
        a
        (loop (sub1 n) (+ a b) a))))

(displayln (fib 30))

Program Output

832040

OK (0.900 sec real, 1.087 sec wall, 56 MB, 13019 syscalls)

Fork