请问程序是哪部分出错了呢?
#include<stdio.h>void main()
{
int n,a,sum,result;
result=0;
n=2;
while(n<=1000)
{a=1;
while(a<n)
{if(n%a==0)
{
sum=sum+a;
a++;}
else
a++;}
if(sum==n)
{printf("%d+",n);
result=result+n;
n++;}
else
n++;}
printf("=%d",result);
}