操作
Problem 1 » 履歴 » リビジョン 1
リビジョン 1/4
| 次 »
Noppi, 2023/12/27 01:29
Problem 1¶
#!r6rs
#!chezscheme
(import (chezscheme))
(define answer-1
(let loop ((n 3) (sum 0))
(cond
[(<= 1000 n) sum]
[(or (zero? (mod n 3)) (zero? (mod n 5)))
(loop (add1 n) (+ sum n))]
[else (loop (add1 n) sum)])))
(printf "1: ~D~%" answer-1)
Noppi が2023/12/27に更新 · 1件の履歴