An Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits.
For example:
- 9 is an Armstrong number, because
9 = 9^1 = 9
- 10 is not an Armstrong number, because
10 != 1^2 + 0^2 = 1
- 153 is an Armstrong number, because:
153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
- 154 is not an Armstrong number, because:
154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190
Write some code to determine whether a number is an Armstrong number.
In order to run the tests for this track, you will need to install DUnitX. Please see the installation instructions for more information.
If Delphi is properly installed, and *.dpr
file types have been associated with Delphi, then double clicking the supplied *.dpr
file will start Delphi and load the exercise/project. control + F9
is the keyboard shortcut to compile the project or pressing F9
will compile and run the project.
Alternatively you may opt to start Delphi and load your project via. the File
drop down menu.
We monitor the Pascal-Delphi support room on gitter.im to help you with any questions that might arise.
Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the exercism/delphi/<exerciseName>
directory.
For example, if you're submitting ubob.pas
for the Bob exercise, the submit command would be something like exercism submit <path_to_exercism_dir>/delphi/bob/ubob.pas
.
Wikipedia https://en.wikipedia.org/wiki/Narcissistic_number
It's possible to submit an incomplete solution so you may receive assistance from a mentor.