0
已解决
#include<iostream>
#include<cstdio>
#include<iomanip>
using namespace std;
int main(){
for(int a=1;a<=9;++a){
for(int b=0;b<=9;++b)
for(int c=0;c<=9;++c)
if(a*a*a+b*b*b+c*c*c==a*100+b*10+c){
cout<<setw(6)<<a+100+b*10+c;
}
}
return 0;
}
I don't know if I've left out "Narcissus is an n-digit number (n ≥ 3), and the sum of the nth powers of the numbers in each of its bits is equal to itself." this sentence???
我不清楚我是不是漏了“水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身。”
这句话???
1019 3位水仙花数经验值:0
题目描述 Description
水仙花数是指一个 n 位数 ( n≥3 ),它的每个位上的数字的 n 次幂之和等于它本身。
3位水仙花数则是指一个3位数,它的个位,十位和百位的数字的3次幂之和等于它本身
输入描述 Input Description
无
输出描述 Output Description
输出从100-999之间所有的水仙花数,并以空格分开。
样例输入 Sample Input
无
样例输出 Sample Output
153 3XX ... ...