水仙花数
求 100~999的水仙花数#include<cstdio>
#include<iostream>
int main()
{
int x,y,z,n;
x=1;
y=0;
z=0;
n==100*x+10*y+z;
for (x=1;x<=9;x++)
for (y=0;y<=9;y++)
for (z=0;z<=9;z++)
for (n=100;n<=999;n++)
if (n==x*x*x+y*y*y+z*z*z)
printf("%d\n",n);
return 0;
}
请各位大虾拜托看看哪错了? 新手初来乍到~