22 lines
432 B
Plaintext
22 lines
432 B
Plaintext
local fn McNuggetsProblem
|
|
BOOL l(100)
|
|
long a, b, c, i, n
|
|
|
|
for a = 0 to 100/6
|
|
for b = 0 to 100/9
|
|
for c = 0 to 100/20
|
|
n = a * 6 + b * 9 + c * 20
|
|
if n <= 100 then l(n) = YES
|
|
next
|
|
next
|
|
next
|
|
for i = 100 to 1 step -1
|
|
if l(i) == NO then print "The maximum non-McNuggets number less than 100 is: "; i: exit for
|
|
next
|
|
end fn
|
|
|
|
window 1,,( 0, 0, 450, 100 )
|
|
fn McNuggetsProblem
|
|
|
|
HandleEvents
|