大一萌新求助:请问各位大佬我这个程序有什么错?
#include<stdio.h>int main()
{int a,b,c;
a=1;
while(a<=1000)
{c=0;
for(b=1;b<a;b++)
if(a%b==0)
c=c+b;
if(c==a)
printf("%d\n",a);
}
}
#include<stdio.h> int main() { int a, b, c; a = 1; while (a <= 1000) { c = 0; for (b = 1; b<a; b++) if (a%b == 0) c = c + b; if (c == a) printf("%d\n", a); a++; } return 0; }
[此贴子已经被作者于2017-10-25 00:05编辑过]