#include
#define len 3
#define max 1000
using namespace std;
int isSXH(int d)
{//d>0
int temp = d;
int i = 0;
int darr[len] = {0};
do
{
darr[i] = d;
i++;
//darr[i] =d;
d /=10;
}while(d != 0);
int add = 0;
for (i = 0;i
{add += darr[i]*darr[i]*darr[i];
}
if (temp == add)
{return 1;
}
return 0;//不是水仙花数返回0;
}
int main()
{
//cout<<isSXH(153)<<endl;
for (int i=1;i
{
if (isSXH(i) == 1)
{
cout<<i<<'\t';
}
}
cout<<endl;
return 0;
}