You are on page 1of 1

maximum two

(defun ifmax(a b)(if (> a b) a (if(> b a) b 'equal)))

maximum three

(defun ifmax3(a b c) (if (and(> a b)(> a c)) a (if(and(> b a)(> b c)) b (if(and(>
c a)(> c b)) c 'equal))))

(defun ifmax3(a b c) (if (and(> a b)(> a c)) (if(and(> b a)(> b c)) b (if(and(> c
a)(> c b)) c 'equal))))

triangle

>(defun check(x y z) (if (> (+ y z) x) "triangle" "not triangle"))

CHECK

>(defun triangle (a b c) (if (and (> a b)(> b c)) (check a b c) (if (and (> b a)
(> a c)) (check b a c) (check c a b))))