A positive number > 0 is “strange” if when adding each of its digits raised to the number of digits that make it up, we obtain the number itself.
For example, 153 (which has three digits) is “strange”, 153 = 13 + 53 + 33
Make a program that reads a positive integer and checks if it is "strange" or not.
Input
A positive integer > 0 and < 10000
Output
Prints the input number and says if it is a “strange” number or not
Observation
It is forbidden to use any external function except, cin
and
cout
, and also the program must be well documented if not it will be
invalidated.
Input
3
Output
strange number: 3
Input
153
Output
strange number: 153
Input
12
Output
not strange number: 12