Canadian Computing Competition: 2000 Stage 1, Junior #2
The digits
,
, and
look much the same if rotated
degrees on the page (turned upside down). Also, the digit
looks much like a
, and vice versa, when rotated
degrees on the page. A multi-digit number may also look like itself when rotated on the page; for example
and
do, but
and
do not.
You are to write a program to count how many numbers from a given interval look like themselves when rotated
degrees on the page. For example, in the interval
there are six:
,
,
,
,
, and
.
Your program should take as input two integers,
and
, which define the interval to be checked,
. The output from your program is the number of rotatable numbers in the interval.
You may assume that all input is valid.
Sample Input
Copy
1
100
Sample Output
Copy
6
Comments
this one is a bit tricky, but its not too complicated if you have done an ambigram before. you really want to focus on reversing the numbers(list) and then configureing the 6's and 9's so that you will reverse its positions by looping (for loop would be easiest).
This comment is hidden due to too much negative feedback. Show it anyway.
man stfu
Says the one who didn't even solve it yet.
(Please don't just say things are "easy" for no reason, it may make others feel bad)
That's how you deal with them!
nice one