Advertisement
nobody_atall

Untitled

Jan 18th, 2021
1,594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.27 KB | None | 0 0
  1. (define (max a b c)
  2.   (if (> a b)
  3.     (if (> b c)
  4.       (list a b)
  5.       (list a c))
  6.     (if (> a c)
  7.       (list b a)
  8.       (list b c))))
  9.  
  10. (define (sum-square x y)
  11.   (+ (* x x) (* y y)))
  12.  
  13. (define (sum-max a b c)
  14.   (apply sum-square (max a b c)))
  15.  
  16. (sum-max 2 4 4)
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement