Created
December 17, 2011 13:43
-
-
Save omegatakuma/1490245 to your computer and use it in GitHub Desktop.
AVTOKYOでチケットを買う時はこのプログラムを是非。
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
avtokyo t = do | |
putStr "当日8000円(a)/前売り5000円(b)/合計(c)" | |
s <- getChar | |
putStr "\n" | |
case s of | |
'a' -> avtokyo (t + 8000) | |
'b' -> avtokyo (t + 5000) | |
'c' -> return t | |
_ -> (do putStr "入力 "; avtokyo t) | |
main = do | |
putStrLn "AVTOKYOのチケットを買うんですね?" | |
n <- buy 0 | |
putStrLn ("全部で"++(show n)++"円です。お金は足りますか?!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment