Created
December 22, 2015 07:22
-
-
Save autotaker/ebed443ea61424295eca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec read_ints acc = | |
try | |
let v = read_int() in | |
read_ints (v::acc) | |
with | |
_ -> List.rev acc | |
let output_ints = List.iter (fun v -> | |
print_int v; | |
print_newline()) | |
let main _ = | |
let ps = read_ints [] in | |
let start_t = Sys.time() in | |
let qs = List.sort compare ps in | |
let end_t = Sys.time() in | |
Printf.fprintf stderr "Sorting: %.5fs\n" (end_t -. start_t); | |
output_ints qs;; | |
main();; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment