6 lines
133 B
Scheme
6 lines
133 B
Scheme
(define (factorial n)
|
|
(let loop ((i 1)
|
|
(accum 1))
|
|
(if (> i n)
|
|
accum
|
|
(loop (+ i 1) (* accum i)))))
|