countSequences :: Int -> Int -> Integer
countSequences 0 m = 0
countSequences m 0 = 0
countSequences (n) (m) = if (n <= (m+1)) then (truncate((cee (m+1) (n) (0))) + truncate((countSequences (fromIntegral (n-1)) (fromIntegral (m)))))
else truncate(countSequences (fromIntegral (n-1)) (fromIntegral (m)))
factorial :: Float -> Float
factorial 0 = 1
factorial 1 = 1
factorial x = x * factorial(x-1)
cee :: Float -> Float -> Float -> Float
cee x y z = if (x==y) then ((1)/(factorial ((x+z)-(y)))) else ((x) * (cee (x-1) (y) (z+1)))
我真的不能明白爲什麼這個錯誤繼續來了..在截斷應該類型從浮點轉換爲整數所以..無法比擬的預期類型整數
yeahh thanks dblhelix :) – 2011-12-25 00:26:02