Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 336 Bytes

haskell.md

File metadata and controls

20 lines (15 loc) · 336 Bytes

Haskell

The functional way

Contibuted by: LloydTao

functional program eppic performance

-- ebin recursion method
isEven :: Int -> String
isEven 0 = "Even"
isEven 1 = "Odd"
isEven n = isEven (n-2)

main :: IO ()
main = do
    n <- readLn :: IO Int
    putStrLn $ isEven $ abs n