Problem 6 » 履歴 » リビジョン 2
リビジョン 1 (Noppi, 2023/12/27 01:40) → リビジョン 2/4 (Noppi, 2023/12/27 04:47)
[ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] # [[Problem 6]] ```scheme #!r6rs #!chezscheme (import (chezscheme)) (define answer-6 (let loop ([n 1] [sum-all 0] [squared-all 0]) ((n 1) (sum-all 0) (squared-all 0)) (if (< 100 n) (- (expt sum-all 2) squared-all) (loop (add1 n) (+ sum-all n) (+ squared-all (expt n 2)))))) (printf "6: ~D~%" answer-6) ```