View Code of Problem 93

#include<iostream>
using namespace std;
int yinzihe(int x)
{   int sum=0;
	for(int i=1;i<x;i++)
	{
		if(x%i==0) sum=sum+i;
	}
	return sum;
}
int main()
{
	int m,n;
	cin>>m>>n;
	for(int i=m;i<=n;i++)
	{
	     int yzh=yinzihe(i);
	     if(yinzihe(yzh)==i&&i<yzh) cout<<i<<" "<<yzh<<endl;
	}
}

Double click to view unformatted code.


Back to problem 93