Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Long-year/Haskell/long-year.hs
Normal file
10
Task/Long-year/Haskell/long-year.hs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import Data.Time.Calendar (fromGregorian)
|
||||
import Data.Time.Calendar.WeekDate (toWeekDate)
|
||||
|
||||
longYear :: Integer -> Bool
|
||||
longYear y =
|
||||
let (_, w, _) = toWeekDate $ fromGregorian y 12 28
|
||||
in 52 < w
|
||||
|
||||
main :: IO ()
|
||||
main = mapM_ print $ filter longYear [2000 .. 2100]
|
||||
Loading…
Add table
Add a link
Reference in a new issue