Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. (defun square (x) (* x x))
  2.  
  3. (defun sum-square-max-2 (a b c)
  4. (if (< a b)
  5. (if (< c a)
  6. (+ (square a) (square b))
  7. (+ (square c) (square b)))
  8. (if (< c b)
  9. (+ (square b) (square a))
  10. (+ (square c) (square a)))))
  11.  
  12. (defun sum-square-max-2 (a b c)
  13. (cond
  14. ((< c a b) (+ (square a) (square b)))
  15. ((< a c b) (+ (square c) (square b)))
  16. ((< c b a) (+ (square a) (square b)))
  17. (t (+ (square c) (square a)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement