发布网友
共1个回答
热心网友
#include <stdio.h>
void main()
{
int a,b,c,m,count;
count=0;
m=100;
printf("水仙花数为:");
do
{
a=m/100;
b=(m-a*100)/10;
c=m%10;
if(a*a*a+b*b*b+c*c*c==m)
{
printf("%5d",m);
count++;
}
m++;
}
while(m<1000);
printf("\n水仙花数为:%d\n",count);
}