Files
EPITA/algo/ocaml/liste.ml
2025-10-10 16:31:53 +02:00

16 lines
283 B
OCaml

let rec maxprof lst = match lst with
[e] -> e
|e::l -> let m = maxprof l in if e>m then e else m
|[]->failwith "liste vide";;
let rec max2 a l = match l with
[] -> a
|e::l -> if a < e then max2 e l else max2 a l;;
maxprof [3;2;19;4];;