Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- median :: Int -> Int -> Int -> Int
- median x y z = if (((x >= y) && (x <= z)) || ((x <= y) && (x >= z)))
- then x
- else if (((y >= x) && (y <= z)) || ((y <= x) && (y >= z)))
- then y
- else if (((z >= x) && (z <= y)) || ((z <= x) && (z >= y)))
- then z
- {- main = print median 25 11 33 -}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement