Daily C++ Program Challenge (#1)

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
are there any rules to the numbers, ie. can they be the same? for example (0+0+0+0)^4=0x0x0x0
They can't be the same. Different letters mark different digits.
Where did you find those tasks?
I made them myself, so far it's just one, tomorrow I'll make a new one.
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.
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
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.
Topic archived. No new replies allowed.