All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
my house's number (Posted on 2004-06-21) Difficulty: 3 of 5
My house's number can be written as ABCD but it also equals to A^B * C^D. Find the number ..-no computer programs!!!

See The Solution Submitted by Ady TZIDON    
Rating: 4.5000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Poor non-C/C++ people | Comment 10 of 32 |
(In reply to re: Poor AWK people... by Erik O.)

#include <cmath>
main {
for (int a=0; a!=10; a++)
  for (int b=0; b!=10; b++)
    for (int c=0; c!=10; c++)
      for (int d=0; d!=10; d++)
        if (  ( (int)pow(a,b) * (int)pow(c,d) ) == (a*1000 + b*100 + c*10 + d) )
          return (a*1000 + b*100 + c*10 + d);
return (-1);}

And I included the return statements and declared all the variables!

Edited on June 21, 2004, 4:51 pm
  Posted by Thalamus on 2004-06-21 16:41:33

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (8)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information