1 2 3 4 5 6 7 8 9
let read_int () = Scanf.scanf "%d " (fun x -> x) let n = read_int () let rec f i = if i = n then 0 else max (read_int ()) (f (i + 1)) let _ = Printf.printf "%d\n" (f 0)