操作
Problem 2 » 履歴 » リビジョン 1
リビジョン 1/4
| 次 »
Noppi, 2023/12/27 01:31
Problem 2¶
#!r6rs
#!chezscheme
(import (chezscheme))
(define answer-2
(let loop ((first 0) (second 1) (result 0))
(let ((next (+ first second)))
(cond
[(< 4000000 next) result]
[(even? next)
(loop second next (+ result next))]
[else (loop second next result)]))))
(printf "2: ~D~%" answer-2)
Noppi が2023/12/27に更新 · 1件の履歴