Scanf.scanf "%d" (fun n -> let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in let rec loop i k = if i < n then ( let k = if i = 0 then 1 else if a.(i) > a.(0) then k + 1 else k in Printf.printf "%d\n" k; loop (i + 1) k ) in loop 0 0 )