/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
int i,j,s=0,k=0,a[100];
/*
数组a要足够的大,否则无法放下k,当然这个数组有点长了。*/
for (i=2;i<=1000;i++)
{
s=0;
for (j=1,k=0;j<i;j++)
{
if(i%j==0)
{
s=s+j;
a[k]=j;
k=k+1;
}
}
if(s==i)
{printf("%d is factor are: %d",s,a[0]);
for(s=1;s<k;s++)
printf(",%d",a[s]);
printf("\n");
}
}
}