您需要的唯一输入是您获得的年级编号。这就是我到目前为止所拥有的。
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"
这给了我一个错误“输入'if'上的解析错误”,我也尝试过:
myScore x = (if x > 90 then "You got an A" | if 80 < x < 90 then "You got a B" | if 70 < x < 80 then "You got a D" | if 60 < x < 70 then "You got a D" else "You got a F")
但这也没有用。