Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
23
Task/McNuggets-problem/XBasic/mcnuggets-problem.basic
Normal file
23
Task/McNuggets-problem/XBasic/mcnuggets-problem.basic
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
PROGRAM "McNuggets problem"
|
||||
VERSION "0.0000"
|
||||
|
||||
DECLARE FUNCTION Entry ()
|
||||
|
||||
FUNCTION Entry ()
|
||||
DIM N[100]
|
||||
|
||||
FOR A = 0 TO 100/6
|
||||
FOR B = 0 TO 100/9
|
||||
FOR C = 0 TO 100/20
|
||||
K = A*6+B*9+C*20
|
||||
IF K <= 100 THEN N[K] = 1
|
||||
NEXT C
|
||||
NEXT B
|
||||
NEXT A
|
||||
|
||||
FOR K = 100 TO 1 STEP -1
|
||||
IF N[K] <> 1 THEN PRINT "Maximum non-McNuggets number is: "; K : EXIT FOR
|
||||
NEXT K
|
||||
|
||||
END FUNCTION
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue