Problem 5 » 履歴 » バージョン 1
Noppi, 2023/12/27 01:37
1 | 1 | Noppi | [ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] |
---|---|---|---|
2 | # [[Problem 5]] |
||
3 | |||
4 | ```scheme |
||
5 | #!r6rs |
||
6 | #!chezscheme |
||
7 | |||
8 | (import (chezscheme)) |
||
9 | |||
10 | (define answer-5 |
||
11 | (let ((n (* 11 13 15 16 17 19))) |
||
12 | (let loop ((i n)) |
||
13 | (if (and |
||
14 | (zero? (mod i 12)) |
||
15 | (zero? (mod i 14)) |
||
16 | (zero? (mod i 18)) |
||
17 | (zero? (mod i 20))) |
||
18 | i |
||
19 | (loop (+ i n)))))) |
||
20 | |||
21 | (printf "5: ~D~%" answer-5) |
||
22 | ``` |