diff options
| author | Mistivia <i@mistivia.com> | 2024-11-09 01:26:37 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2024-11-09 01:35:37 +0800 |
| commit | 37be9418ad8f5bbde5f7b703115a2d4fb5d6185e (patch) | |
| tree | 88888561c98ca9e459ca9978a8fd79ae5aec2b0a /0001/main.lisp | |
| parent | ab11ad9a8b6cf46131620a49486e91656b9d913b (diff) | |
2 Even Fibonacci Numbers
Diffstat (limited to '0001/main.lisp')
| -rwxr-xr-x[-rw-r--r--] | 0001/main.lisp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/0001/main.lisp b/0001/main.lisp index c7ba165..0ce3d1d 100644..100755 --- a/0001/main.lisp +++ b/0001/main.lisp @@ -1,13 +1,13 @@ (defun genlist (n) (defun impl (x lst) (if (> x n) - (reverse lst) - (impl (+ 1 x) (cons x lst)))) + (reverse lst) + (impl (+ 1 x) (cons x lst)))) (impl 1 '())) (let ((sum 0)) (loop for x in (genlist 999) - do (if (or (equal 0 (mod x 3)) + do (if (or (equal 0 (mod x 3)) (equal 0 (mod x 5))) (setf sum (+ sum x)))) (print sum)) |
