我想获得 3 个数字作为输入并给出多个结果作为输出。
我的代码:
t :: Integer -> Integer -> Integer -> (Integer,Integer,Integer)
t a b c = ((a+b)/2,(a+b+c)/3,(b+c)/2)
但这似乎是一个问题:
Lab2.hs:17:17:
No instance for (Fractional Integer) arising from a use of `/'
Possible fix: add an instance declaration for (Fractional Integer)
In the expression: (a + b) / 2
In the expression: ((a + b) / 2, (a + b + c) / 3, (b + c) / 2)
In an equation for `t':
t a b c = ((a + b) / 2, (a + b + c) / 3, (b + c) / 2)
Failed, modules loaded: none.
问题是多输出或我尝试做的除法......