Euler : Problem 1

Posted by YpsilonTAKAI On 2011年4月9日土曜日 0 コメント
さて、問題1です。
まあ、そんなに難しくはないね。

;;
;; Problem 1 : 2011/4/4
(defn is-3x-or-5x? [x]
(or (zero? (rem x 3))
(zero? (rem x 5))))

(reduce + (filter is-3x-or-5x? (range 1 10000)))

;;

0 コメント:

コメントを投稿