Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/McNuggets-problem/FutureBasic/mcnuggets-problem.basic
Normal file
21
Task/McNuggets-problem/FutureBasic/mcnuggets-problem.basic
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue