An n-digit number that is the sum of the n-th powers of its digits is called an n-narcissistic number. It is also sometimes known as an Armstrong number, perfect digital invariant (Madachy 1979), or plus perfect number. Hardy (1993) wrote, "There are just four numbers, after unity, which are the sums of the cubes of their digits: 153=1^3+5^3+3^3, 370=3^3+7^3+0^3, 371=3^3+7^3+1^3, and 407=4^3+0^3+7^3. These are odd facts, very suitable for puzzle columns and likely to amuse amateurs, but there is nothing in them which appeals to the mathematician." Narcissistic numbers therefore generalize these "unappealing" numbers to other powers (Madachy 1979, p. 164).
The smallest example of a narcissistic number other than the trivial 1-digit numbers is:
153=1^3+5^3+3^3
For a given positive number "n", which indicates that there are n-digits. You are requested to find and output all these Narcissistic Numbers in order. If no such number exists, output "No".
Input
An Integer n
Output
All the Narcissistic Numbers of n-digit in natural order.
Sample Input
1
Sample Output
1 2 3 4 5 6 7 8 9
就满足153=1^3+5^3+3^3 这样的 这个数字的/各个数位的数字/的数位次方/之和/等于这个数。就是说153=1^3+5^3+3^3这个式子中的三次幂是三位数,如果是两位数就是二次幂。
输入1按顺序显示所有的满足Narcissistic number的一位数
输入2按顺序显示所有的满足Narcissistic numbers的两位数
题目大概是这个意思。。另外输出的时候数字与数字之间有空格 最后一个数后没有空格而是回车
就满足153=1^3+5^3+3^3 这样的 这个数字的/各个数位的数字/的数位次方/之和/等于这个数。就是说153=1^3+5^3+3^3这个式子中的三次幂是三位数,如果是两位数就是二次幂。
输入1按顺序显示所有的满足Narcissistic number的一位数
输入2按顺序显示所有的满足Narcissistic numbers的两位数