Learning Java on a Ubuntu Linux 10.04 Machine
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Learning Java on a Ubuntu Linux 10.04 Machine
Daniel Brackett wrote:How does one check the exit path? what is the exit path?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
How does one check the exit path? what is the exit path?
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Michael Krimgen wrote:by the way, is it an exercise to practise recursion?
Otherwise, I believe that a single for-loop would do the job and the code would be easier to understand an debug. :-)
Cheers,
Michael
Learning Java on a Ubuntu Linux 10.04 Machine
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Michael Krimgen wrote:how about
I don't want to do your work here...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Learning Java on a Ubuntu Linux 10.04 Machine
Campbell Ritchie wrote:Challenge: Now do it without using % 5. You only need one % operator. You do need two loops, but miss out most of the % tests which will come out false.
Campbell Ritchie wrote:Not bad. I shall have to think about that one. Is it a version of the sum of an arithmetical progression?
Campbell Ritchie wrote:Yes, 1 + 2 + 3 +...+ n is an arithmetical progression, as is 3 + 9 + 12 ... + n. What do you do about duplicates, eg 15?
Daniel Brackett wrote:
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Don't get me started about those stupid light bulbs. |