2013-10-27 22:24:23 +00:00
|
|
|
import Control.Monad (replicateM, mapM_)
|
2013-04-11 01:07:29 -07:00
|
|
|
|
2018-08-17 15:15:24 +01:00
|
|
|
f :: Floating a => a -> a
|
|
|
|
|
f x = sqrt (abs x) + 5 * x ** 3
|
2013-04-11 01:07:29 -07:00
|
|
|
|
2018-08-17 15:15:24 +01:00
|
|
|
main :: IO ()
|
2013-04-11 01:07:29 -07:00
|
|
|
main = do
|
2018-08-17 15:15:24 +01:00
|
|
|
putStrLn "Enter 11 numbers for evaluation"
|
|
|
|
|
x <- replicateM 11 readLn
|
|
|
|
|
mapM_
|
|
|
|
|
((\x ->
|
|
|
|
|
if x > 400
|
|
|
|
|
then putStrLn "OVERFLOW"
|
|
|
|
|
else print x) .
|
|
|
|
|
f) $
|
|
|
|
|
reverse x
|