Posted by Anonymous on Saturday, March 12, 2011 at 5:36pm.
The digits 0, 1, and 8 look much the same if rotated 180 degrees on the page (turned
upside down). Also, the digit 6 looks much like a 9, and vice versa, when rotated 180
degrees on the page. A multi-digit number may also look like itself when rotated on the
page; for example 9966 and 10801 do, but 999 and 1234 do not.
You are to write a program to count how many numbers from a given interval look like
themselves when rotated 180 degrees on the page. For example, in the interval [1..100]
there are six : 1, 8, 11, 69, 88, and 96.
Your program should take as input two integers, m and n, which define the interval to be
checked, 1 ≤ m ≤ n ≤ 32000. The output from your program is the number of rotatable
numbers in the interval.
You may assume that all input is valid.
Input/output is not from/to files for this question. Keyboard input and screen output is
Sample Session User input is in italics.
Enter the lower bound of the interval:
Enter the upper bound of the interval:
The number of rotatable numbers is:
I am kind of stuck withe logic... help me please.
No one has answered this question yet.
Answer this Question
probability - out of 250 students interviewed at a community college, 90 were ...
computer - What does tenure track, part time instructor of computer science does...
math - the binary system is used for computer programming. a binary number ...
math - x has 3 digits. the tens digits is half the hundreds digits. the number ...
CSC 111 Intruduction to Computer Science - What does it imply to pursue a ...
English - Let's write down what you can do with the computer. 1. I use the ...
computer science - write a program to select the classes that you are taking(Ex...
math - Solve the mathematical puzzle. Determine the digits of F from these clues...
Computer Programming - I am trying to put the following in Python Code. I know ...
math - A locker combination has three nonzero digits, and digits cannot be ...