Anonymous user
Combinations with repetitions: Difference between revisions
→{{header|PHP}}: output
(PHP) |
(→{{header|PHP}}: output) |
||
Line 846:
<lang PHP>
<?php
function combos($arr, $k) {
if ($k == 1) {
Line 893 ⟶ 889:
echo "$num_donut_combos ways to order 3 donuts given 10 types";
?>
</lang>
output in the browser:
<lang>
iced iced
iced jam
iced plain
jam jam
jam plain
plain plain
220 ways to order 3 donuts given 10 types
</lang>
|