Last active
September 20, 2017 11:43
-
-
Save sooop/ea69aee1b8e2f405d347fe4c712e0751 to your computer and use it in GitHub Desktop.
5각수 구하기 - 하스켈 (https://www.hackerrank.com/challenges/pentagonal-numbers/problem)
This file contains hidden or 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
| pen n = (flip div 2) $ n * (n * 3 - 1) | |
| main = getLine >> getContents >>= putStrLn . unlines . map (show . pen .read) . lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment