McNuggets problem: Difference between revisions
Added XPL0 example.
Not a robot (talk | contribs) (Add CLU) |
(Added XPL0 example.) |
||
Line 2,126:
Maximum non-McNuggets number is 43
</pre>
=={{header|XPL0}}==
<lang XPL0>int N, A(101), X, Y, Z;
[for N:= 0 to 100 do A(N):= false;
for X:= 0 to 100/6 do
for Y:= 0 to 100/9 do
for Z:= 0 to 100/20 do
[N:= 6*X + 9*Y + 20*Z;
if N <= 100 then A(N):= true;
];
for N:= 100 downto 0 do
if A(N) = false then
[IntOut(0, N);
exit;
];
]</lang>
{{out}}
<pre>43</pre>
=={{header|zkl}}==
|