let () = let rec doit i = if i = 10 || i <> Scanf.scanf "%d " (fun i -> i) then i else doit (i + 1) in doit 1 |> Printf.printf "%d\n"