题目链接:http://bailian.openjudge.cn/practice/2686
#include <stdio.h>
int main()
{
int i,j,k,l,a[500],count;
for(i=2;i<=1000;i++)
{
count=0;
for(j=1,k=0;j<=i/2;j++,k++)
{
if(i%j==0)
{
count=count+j;
a[k]=j;
}
l=k;
}
if(count==i)
{
printf("%d its factors are 1",i);
for(j=1;j<=l;j++)
if(i%a[j]==0)
printf(",%d",a[j]);
printf("\n");
}
}
return 0;
}