Mar 3, 2013 at 10:25am UTC
Hello everyone. Just some short, but interesting C++ (using Dev-C++) challenges that will get you thinking.
"Write an algorithm to find and print out all 4 digit numbers abcd , which match the equation (a+b+c+d)^4=abcd .
The same letters mark the same digits."
Good luck and have fun :)
Last edited on Mar 3, 2013 at 1:04pm UTC
Mar 3, 2013 at 11:28am UTC
are there any rules to the numbers, ie. can they be the same? for example (0+0+0+0)^4=0x0x0x0
Mar 3, 2013 at 11:52am UTC
They can't be the same. Different letters mark different digits.
Mar 3, 2013 at 12:04pm UTC
Where did you find those tasks?
Mar 3, 2013 at 12:07pm UTC
I made them myself, so far it's just one, tomorrow I'll make a new one.
Mar 3, 2013 at 12:43pm UTC
I don't see how it's an C++ (or rather programming) challenge. Solving this with pen and paper actually faster than writing code for it.
Mar 3, 2013 at 12:56pm UTC
This is really a beginners, and also if the numbers were bigger, it would be extremely difficult to solve it by hand. It's a short code btw
Mar 3, 2013 at 1:16pm UTC
It reminds me of ProjectEuler challenges, which requires use of unortodox thinking, bruteforcing it with aid of computer or combining both and comparing your programm lenght to others on forums.