[ create a new paste ] login | about

Link: http://codepad.org/hFzyK228    [ raw code | fork ]

OCaml, pasted on Jan 1:
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)


Create a new paste based on this one


Comments: