Wednesday, August 9, 2006

Programming riddle 1

I have needed to do this for a topcode.com problem, the problem was to rotate an integer, so 78 becomes 87 and 40098 becomes 984. I have sloved it (numerically, not as string). But I am gonna give you a part of it to solve, get me the highest significant digit. In 78639 the highest signigicant digit is 7. It is the left most one. Anyone have an idea :) ?
You are to solve it numerically, not by converting it to string and getting the first character.

(hint: highlight the text to see the hint
consider using logarithms
)

No comments: