Sunday, March 14, 2010

The Fourth Annual Computer Competition (Part 3 of 4)

(Introduction and Part 1Part 2, Part 3Part 4)
The third question, Question #4.

Question #4: Senior Division

The integers 12, 21, 13 and 31 have the following characteristic:
12 times 12 = 144 and 21 times 21 = 441
13 times 13 = 169 and 31 times 31 = 961
Write a program that identifies all 3-digit integers (if any) between 100 and 400 for which this same kind of relationship holds. (That is, a 3-digit number whose square and the square of its "reverse" are mirror images.)

Important notes:

The number and its "reverse" must:
(a) both be true 3-digit numbers
(b) not be identical.
Examples: the following integers (among others) do not qualify:
100 (because its reverse integer is 1)
120 (because its reverse integer is 21)
121 (because its reverse integer is identical)

SAMPLE RUN
NOTE:

When your program is RUN by the judge it should list all the integers between 100 and 400 that qualify or state that no integers qualify, if that is the case.

No comments: