#include <stdio.h>
/*1000以内所有完数及其因子*/
int main()
{
int n=1000;
int i,j,r;
for(i=1;i<n;i++)
{
r=0;
for(j=1;j<i;j++)
{
if(i%j==0)
{
r=r+j;
}
}
if(r==j)
{
printf("%d:",r);
for(j=1;j<i;j++)
{
if(i%j==0)
printf("%d ",j);
}
printf(" ");
}
}
return 0;
}
09-15
507
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-06