差分
ナビゲーションに移動
検索に移動
細
match x with | x when x <= 0 -> failwith "1以上の整数が必要です"0 | 1 -> 1 | 2 -> 1 | x -> fib (x - 1) + fib (x - 2) [0 .. 16] |> Seq.iter (fun x -> printfn "fib(%O) = %dO" x (fib 15x));;
<source lang="fsharp">
let rec fib x =
</source>