#include"stdio.h"
void main()
{
int m,n;
int sum,i,j;
printf("Please enter the range [m,n]:\n");
scanf("%d%d",&m,&n);
printf("\n");
printf("the Perfect number is :\n");
for(i=m;i<=n;i++)
{
sum=0;
for(j=1;j<i;j++)
{
if(i%j==0)
sum+=j;
}
if(i==sum)
printf("%d\t",i);
}
}
2021-1-19
最新推荐文章于 2024-08-31 14:54:37 发布