Created
July 29, 2012 12:44
-
-
Save moznion/3198484 to your computer and use it in GitHub Desktop.
スタートHaskell 2 第2回目演習 うるう年
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isLeap :: Int -> Bool | |
isLeap x | |
| canBeDividedBy 4 && not (canBeDividedBy 100) = True | |
| canBeDividedBy 400 = True | |
| otherwise = False | |
where | |
canBeDividedBy y = x `mod` y == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment