Skip to content

Commit

Permalink
small
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinhyuk Jeon committed Aug 29, 2018
1 parent 4a14ab3 commit b72997c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
Binary file modified a.out
Binary file not shown.
Binary file added test7.cmi
Binary file not shown.
Binary file added test7.cmo
Binary file not shown.
26 changes: 24 additions & 2 deletions test7.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,34 @@ let fact = add a b
else gcd (a-b) b
*)

let rec gcd a b =
(*let rec gcd a b =
match (a,b) with
| (1,_) | (_,1) -> 1
| _ ->
if a=b then a
else if a<b then gcd b a
else gcd (a-b) b
*)

(*let rec sum_of_list l =
match l with
| [] -> 0
| h::t -> h + sum_of_list t
*)

(*let rec length l =
match l with
| []-> 0
| _::t -> 1+ length t
*)


let _ = print_endline (string_of_int (length [1;2;3;4;5]))








let _ = print_endline (string_of_int (gcd 24 4))

0 comments on commit b72997c

Please sign in to comment.