3
我在OCaml的程序中有一個錯誤,我在尋求幫助。此表達式具有類型單位,但表達式類型爲int
錯誤:
This expression has type unit but an expression was expected of type int
與錯誤路線錯誤包含soma = soma
let soma = 0;;
let rec nBell n =
if n == 0 then 1
else
for k=0 to n-1 do
soma = soma + ((fact(n-1)/(fact(k)*fact((n-1)-k))) * nBell(k));
done;;`
誰能幫助我?