Knapsack problem/Continuous: Difference between revisions

→‎{{header|GNU APL}}: minor edit to output printing
(→‎{{header|GNU APL}}: adding output display section)
(→‎{{header|GNU APL}}: minor edit to output printing)
Line 183:
 
⍝ Output
⍞←2 1 ⍴ (⊂⎕←'ITEM' 'WEIGHT AVAILABLE' 'WEIGHT SELECTED' ⍪ Take ) , (⊂'total cost' TotalCost)
⎕←''
⎕←'total cost:' TotalCost
</lang>
{{out}}
<pre>
ITEM WEIGHT AVAILABLE WEIGHT SELECTED
ham 3.6 3.6
greaves 2.4 2.4
brawn 2.5 2.5
welt 3.7 3.5
salami 3 3
 
total cost: 349.3783784
</pre>
 
Anonymous user