Add test.lisp

This commit is contained in:
Anthony Wang 2020-09-09 11:21:53 -05:00
parent ef197cb02c
commit 7a5f28099c
Signed by: a
GPG key ID: 6FD3502572299774

22
test.lisp Normal file
View file

@ -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)