Skip to content

Instantly share code, notes, and snippets.

@omegatakuma
Created December 18, 2011 12:35
Show Gist options
  • Save omegatakuma/1493269 to your computer and use it in GitHub Desktop.
Save omegatakuma/1493269 to your computer and use it in GitHub Desktop.
パソコン甲子園2010の過去問といてみた.問題番号[1]
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