My house's number can be written
as ABCD but it also equals to
A^B * C^D.
Find the number ..-no computer programs!!!
(In reply to
re: Poor AWK people... by Erik O.)
I'd worry that
If A^B*C^D = A*1000+B*100+C*10+D Then
might fail, as exponentiation uses logarithms rather than multiplication, and is thus subject to rounding errors. Since it's known that A, B, C and D are integers, it's safe to round to an integer:
If Int(A^B*C^D+.5) = A*1000+B*100+C*10+D Then
so that even if A^B*C^D comes out to 2592.000001 or 2591.999999, a match will still be found.
|
Posted by Charlie
on 2004-06-22 09:58:02 |