style: begin/end

This commit is contained in:
2020-11-08 10:25:15 +08:00
parent c36b20c671
commit b663bc9205

4
gcd.ml
View File

@@ -6,10 +6,10 @@ let rec gcd a b =
let main () =
let len = Array.length Sys.argv in
Printf.printf "array length %d\n" len;
if len < 3 then (
if len < 3 then begin
Printf.printf "must have 2 args";
exit 0;
);
end;
let a = int_of_string Sys.argv.(1) in
let b = int_of_string Sys.argv.(2) in
Printf.printf "gcd of %d and %d is %d\n" a b (gcd a b);