Skip to content

Instantly share code, notes, and snippets.

@moznion
Created July 29, 2012 12:44
Show Gist options
  • Save moznion/3198484 to your computer and use it in GitHub Desktop.
Save moznion/3198484 to your computer and use it in GitHub Desktop.
スタートHaskell 2 第2回目演習 うるう年
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