(* * $Id: fibo.ocaml,v 1.3 2001/01/08 03:01:50 doug Exp $ * http://www.bagley.org/~doug/shootout/ *) let rec fib n = if n < 2 then 1 else fib (n - 2) + fib (n - 1) let _ = let n = try int_of_string Sys.argv.(1) with Invalid_argument _ -> 1 in Printf.printf "%d\n" (fib n)