elz: (ada-tubes)
elz ([personal profile] elz) wrote in [community profile] intro_to_cs 2009-11-19 12:10 am (UTC)

I've spent the last three days writing code for other things, so I'm just tackling the McNuggets now. :)

Problem 1:

6a,9b,20c = n
2,2,1 = 50
1,5,0 = 51
2,0,2 = 52
1,3,1 = 53
0,6,0 = 54
1,1,2 = 55

If you add 6 to those totals, you get 56,57,58,59,60,61.
If you add 6 to those totals, you get 62,63,64,65,66,67.

Problem 2:

So basically, once the condition is true for any run of six, it's true for that run of six + 6, which works out to every number greater than the start of the first run of six. If it were true for a run of nine, it would also be true for that run of nine + 9, etc.

Post a comment in response:

This community only allows commenting by members. You may comment here if you're a member of intro_to_cs.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting