#include<stdio.h>
void main()
{ int count=0,i,j;
for(i=1;i<=1000;i++)
{
int sum=0;
for(j=1;j<=i/2;j++)
{
if(i%j==0)
{
sum+=j;
}
}
if(sum==i)
{
count++;
printf("\n%5d is a wanshu\n",i);
for(j=1;j<=i/2;j++)
{
if(i%j==0)
printf("%5d",j);
}
}
}
printf("The total number is %d\n",count);
getch();
}
void main()
{ int count=0,i,j;
for(i=1;i<=1000;i++)
{
int sum=0;
for(j=1;j<=i/2;j++)
{
if(i%j==0)
{
sum+=j;
}
}
if(sum==i)
{
count++;
printf("\n%5d is a wanshu\n",i);
for(j=1;j<=i/2;j++)
{
if(i%j==0)
printf("%5d",j);
}
}
}
printf("The total number is %d\n",count);
getch();
}