View Code of Problem 93

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int yinzihe(int n){
	int sum=0;
	for(int i=1;i<n;i++){
		if(n%i==0){
			sum+=i;
		}
	}
	return sum;
}
int main(){
	int m,n;
	scanf("%d %d",&m,&n);
	//printf("%d %d",yinzihe(220),yinzihe(284));
	for(int i=m;i<=n;i++){
		int a=yinzihe(i);
		int b=yinzihe(a);
		if(i==b&&i<a){
			printf("%d %d\n",i,a);
		}
	}
}



	

Double click to view unformatted code.


Back to problem 93