View Code of Problem 93

#include<stdio.h>
int yihe(int a)
{ 
   int i,f;
     f=1;
     for(i=2;i<a;i++)
     {
     	if((a%i)==0)
     	   f=f+i;
	 }
	 return f;
	
}
int main ()
{
	int b,n=100,m=1000;
	scanf("%d %d",&n,&m);
	for(int i=n;i<=m;i++)
	{
		b=yihe(i);
        if(i==yihe(b)&&b>i)
        printf("%d %d\n",i,b);
	}
}

Double click to view unformatted code.


Back to problem 93