SCJP
Visit my download page
Randall Twede wrote:i get 4 errors all based on the compiler thinking i am talking integer when i mean String!
Joanne
SCJP
Visit my download page
SCJP
Visit my download page
SCJP
Visit my download page
Joanne
SCJP
Visit my download page
SCJP
Visit my download page
SCJP
Visit my download page
SCJP
Visit my download page
SCJP
Visit my download page
Randall Twede wrote:well that was no help i get errors saying
unclosed string literal
integer number too large
etc.
Also note that your new String() is completely pointless. In fact, there's probably never a good reason to use String's no-arg constructor.
SCJP
Visit my download page
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Randall Twede wrote:yeah i figured out what you meant.
Also note that your new String() is completely pointless. In fact, there's probably never a good reason to use String's no-arg constructor.
yeah i only separated the declaration from the instantiation in desperation. i should change it back. anyway it works fine now and solves the problem.
fred rosenberger wrote:I'm just curious as to what you are doing here. 2^(any integer power) cannot end it a 0.
And IMHO, the point of the exercise is not to add up a bunch of digits, but to come up with a clever way of calculating 2^1000.
Saurabh Pillai wrote:
Can somebody tell me what does "Greatest Product" mean? Is it Greatest Common denominator?
fred rosenberger wrote:I'm just curious as to what you are doing here. 2^(any integer power) cannot end it a 0.
And IMHO, the point of the exercise is not to add up a bunch of digits, but to come up with a clever way of calculating 2^1000.
BTW, is there a clever way to sum up the digits of 2^1000?
SCJP
Visit my download page
Greg Charles wrote:That's how I solved Euler 16 too. Fred implied there's a better way, but I don't think so ... at least not much better.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |