-->
当前位置:首页 > 题库

PROGRAMMING:Calculate the number of n-bit (3 ≤ n ≤ 7) Narcissus

Luz5年前 (2021-05-10)题库395
Narcissistic number is also known as super perfect digital invariant (PPDI), narcissistic number, self idempotent number and Armstrong number.
Narcissus number refers to an n-digit number (n ≥ 3), the sum of the n-th power of each digit is equal to itself (for example: 1 ^ 3 + 5 ^ 3 + 3 ^ 3 = 153; 1^4+6^4+3^4+4^4=1634)。 The program is required to calculate the number of n-bit (3 ≤ n ≤ 7) Narcissus.
###Input format:
The input gives a positive integer n (3 ≤ n ≤ 7) on a line.
###Output format:
Output all n-bit Narcissus numbers in increasing order, each number occupies one line.
###Input example:
Here is a set of inputs. For example:
```in
three
```
###Output example:
The corresponding output is given here. For example:
```out
one hundred and fifty-three
three hundred and seventy
three hundred and seventy-one
four hundred and seven
```







answer:If there is no answer, please comment