Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/McNuggets-problem/Nim/mcnuggets-problem.nim
Normal file
13
Task/McNuggets-problem/Nim/mcnuggets-problem.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const Limit = 100
|
||||
|
||||
var mcnuggets: array[0..Limit, bool]
|
||||
|
||||
for a in countup(0, Limit, 6):
|
||||
for b in countup(a, Limit, 9):
|
||||
for c in countup(b, Limit, 20):
|
||||
mcnuggets[c] = true
|
||||
|
||||
for n in countdown(Limit, 0):
|
||||
if not mcnuggets[n]:
|
||||
echo "The largest non-McNuggets number is: ", n
|
||||
break
|
||||
Loading…
Add table
Add a link
Reference in a new issue