Jump to content

Knapsack problem/Continuous: Difference between revisions

m
Tested with `ocaml-4.02.3`.
m (Tested with `ocaml-4.02.3`.)
Line 2,170:
 
=={{header|OCaml}}==
{{output?|OCaml|reason}}
<lang ocaml>let items =
[ "beef", 3.8, 36;
Line 2,205 ⟶ 2,204:
Printf.printf " Total Price: %.3f\n" (float price +. last_price);
;;</lang>
 
{{out}}
Items Weight Price
greaves: 2.40 45
brawn: 2.50 56
ham: 3.60 90
salami: 3.00 95
welt: 3.50 63.38
Total Price: 349.378
 
=={{header|Oforth}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.