我想在F#中找到没有.NET的数组中的最大值,最小值和平均值.我使用了这段代码,但它没有用:
let mutable max = 0
let arrX = [|9; 11; 3; 4; 5; 6; 7; 8|]
for i in 0 .. arrX.Length - 2 do
if (arrX.[i]) < (arrX.[i+1]) then
max <- arrX.[i]
printfn "%i" max
Run Code Online (Sandbox Code Playgroud)