On Fri, Oct 23, 2009 at 6:29 PM, Rick <[email protected]> wrote: > You have several problems. The biggest problem is probably that you > haven't defined you algorithm correctly. I looked up Armstrong > numbers (here: > http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/arms.html) > and it says "An Armstrong number is a number such that the sum of its > digits raised to the third power is equal to the number itself". > > You are raising the digits to the number of digits in the number, not > by 3. (BTW: I don't believe 153 is a valid Armstrong number as stated > on the web site).
It's not impossible that a clueless tutor has either 1) give insufficient information on the task or 2) totally ignored the 3 digit limit and specified that the program should handle numbers of more than (and/or less than) 3 digits. or 3) the OP has decided for themselves that (2) is the case (thus making more work for themselves.) My money's on (2) -- PJH http://shabbleland.myminicity.com/ http://www.chavgangs.com/register.php?referer=9375 http://www.kongregate.com/?referrer=Shabble
