; 月の値 = (日の値 / 10) + (日の値 % 10) ; となる日を毎月カウントし ; 通年で足し合わせる 答えは 30 (defvar *2015days* #(0 31 28 31 30 31 30 31 31 30 31 30 31)) (defun main () (princ ; from i to j [i, i+1, i+2, ..., j] の範囲を繰り返す (loop for i from 1 to 12 for d = (aref *2015days* i) ; sum 以下の値を足し合わせたものを返す sum (loop for j from 1 to d ; count 条件を満たす要素数を返す count (= i (+ (floor j 10) (mod j 10)))))) (terpri)) (main) ; (defun main () ; (princ 30) ; (terpri)) ; (main)