1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-19 22:16:57 +02:00
CodeWars/8kyu/century_from_year/solution.hs

7 lines
162 B
Haskell
Raw Normal View History

module Century where
century :: Int -> Int
century year = case year `mod` 100 of
0 -> year `div` 100
_ -> 1 + year `div` 100