假设用户输入= 6000并且input.txt内的数字是= 5000.总和将是11000.屏幕上显示的数字和存储在文件中的值将被覆盖为11000.请帮助我,谢谢
import System.IO
menu :: IO ()
menu = do
handle <- openFile "input.txt" ReadMode
contents <- hGetContents handle
putStr contents
hClose handle
contents <- readFile "input.txt"
print . sum . read $ contents
putStr("\nThe amount of money that you want to deposit : ")
y<-getLine
Run Code Online (Sandbox Code Playgroud)