题解 | #输出水仙花数#
输出水仙花数
https://www.nowcoder.com/practice/dabaf13009ef4d0cbf22302fd6a530a6
#include <iostream>
using namespace std;
int main() {
// write your code here......
int sx,a,b,c;
for(int sx=100;sx<=999;sx++){
a=sx%10;//个位
b=sx%100;b=b/10;//十位
c=sx/100;//百位
if(sx == a*a*a+b*b*b+c*c*c)
{
cout<<sx<<endl;
}
}
return 0;
}
