麻烦大佬帮我看看这个求水仙花数的C语言程序哪错了

#include <stdio.h>
#include <math.h>
int main()
{
int n;
double N;
int a,b,c,e,h,E;
printf("请输入一个在3到7的整数(包括3和7):\n");
scanf("%d",&n);
if(n>=3 && n<=7)
{e=100;
E=e;
N=n;
h=0;
b=0;
a=0;
while(E<pow(10,n))
{N=n-1;
while(b!=n)
{
a=e/(pow(10.0,N));
e=e-a*pow(10,N);
h=h+pow(a,n);
b++;
N=N-1;
}
b=0;
if(h==E)
{
printf("%d ",E);
}
E++;
h=0;
}}
else {
printf("输入错误\n");
}
return 0;
}

这变量定义的也太多了吧。。。 还有 整形数据不要随便用除法 容易出错。。。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答