A positive number 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”,
Make a program that reads a positive integer and checks if it is "strange" or not.
A positive integer and
Prints the input number and says if it is a “strange” number or not
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