Created
December 18, 2011 12:35
-
-
Save omegatakuma/1493269 to your computer and use it in GitHub Desktop.
パソコン甲子園2010の過去問といてみた.問題番号[1]
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
sumTo x = (read :: String -> Int) x | |
getInt = do m <- getLine ; return (sumTo m) | |
suido w = do | |
if w == 10 | |
then show(1150-4200) | |
else if w <= 20 | |
then show(4280-(1150+(w-10) * 125)) | |
else if w <= 30 | |
then show(4280-(1150+10*125+(w-20)*140)) | |
else show(4280-(1150+10*125+10*140+(w-30)*160)) | |
main = do | |
w <- getInt | |
putStrLn ("代金は"++(show(suido w))++"です") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment