If you moved the 3 at the end of a certain large number to the beginning, it would be the same as multiplying it by 3. What is the number?
(In reply to
re(3): Standard solution by Richard)
The program is actually just mimicking long division. The variable temp is just the current partial dividend, and succeeding temp values are just the remainder from the previous division with the next digit brought down from the real dividend, which in this case is just the previous partial(singledigit) quotient, as the digits are all offset by one in the whole quotient and the whole dividend. The appending is done arithmetically by multiplying the previous remainder by 10 before adding the newlybroughtdown digit.
The backslash is integer division, producing a wholenumber quotient.

Posted by Charlie
on 20040302 15:46:41 