您需要的唯一输入是您获得的成绩编号.这就是我到目前为止所拥有的.
myScore x = if x > 90
then let x = "You got a A"
if 80 < x < 90
then let x = "you got a B"
if 70 < x < 80
then let x = "You got a C"
if 60 < x < 90
then let x = "you got a D"
else let x = "You got a F"
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误"解析错误输入`if'",我也尝试过:
myScore x = (if x > 90 then "You got an A" | …Run Code Online (Sandbox Code Playgroud) 我的问题是,如果我输入一个包含诸如Hello, today is a Nice Day!!如何摆脱空格和标点符号以及用小写字母替换大写字母的字符串?
我知道如何删除它们但不知道如何替换它们.
还要摆脱标点符号.
对不起,我不知道如何乱用字符串,只有数字.
testList xs = [if x = [,|.|?|!] then " " | x<-xs]
Run Code Online (Sandbox Code Playgroud)