diff options
author | Anthony Wang | 2020-09-09 11:21:53 -0500 |
---|---|---|
committer | Anthony Wang | 2020-09-09 11:21:53 -0500 |
commit | 7a5f28099c4810e986b493e3ba9c6cf5e3f3fbf7 (patch) | |
tree | 270781a5e09e6812b475b6de53e18cf501e7f289 | |
parent | ef197cb02c1810d29ab26ca8d980c9575a583e02 (diff) |
Add test.lisp
-rw-r--r-- | test.lisp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test.lisp b/test.lisp new file mode 100644 index 0000000..f362c4d --- /dev/null +++ b/test.lisp @@ -0,0 +1,22 @@ +;; Common Lisp + +(defun gcd (a b) + (if (> b 0) (gcd b (mod a b)) a) +) + +(princ "test") + +(setq N 1000) + +(setq A ()) +(loop for i from 0 to (- N 1) + do (setq A (append A (list i))) +) + +(setq ans 0) +(loop for i in A + do (loop for j in A + do (setq ans (+ ans (gcd i j))) + ) +) +(print ans) |