Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
24
Task/McNuggets-problem/PureBasic/mcnuggets-problem.basic
Normal file
24
Task/McNuggets-problem/PureBasic/mcnuggets-problem.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
OpenConsole()
|
||||
Define n.i
|
||||
Dim nuggets.i(100)
|
||||
|
||||
For six.i = 0 To 100/6
|
||||
For nine.i = 0 To 100/9
|
||||
For twenty.i = 0 To 100/20
|
||||
n = six*6 + nine*9 + twenty*20
|
||||
If n <= 100
|
||||
nuggets(n) = #True
|
||||
EndIf
|
||||
Next twenty
|
||||
Next nine
|
||||
Next six
|
||||
|
||||
For n = 100 To 1 Step -1
|
||||
If nuggets(n) = #False
|
||||
PrintN("Maximum non-McNuggets number is: " + Str(n))
|
||||
Break
|
||||
EndIf
|
||||
Next n
|
||||
|
||||
PrintN(#CRLF$ + "Press ENTER to exit"): Input()
|
||||
CloseConsole()
|
||||
Loading…
Add table
Add a link
Reference in a new issue