View Code of Problem 93

#include<stdio.h>
#include<string.h>
#include<math.h>
int yin(int x){
	int i,j,k,m,n;
	int sum=0;
	
	for(i=1;i<x;i++){
		
		if(x%i==0){
			sum+=i;
		}
		
	}
	return sum;
	
}
int main(){
	int m,n,i,j,k;
	int sum=0;
	scanf("%d %d",&m,&n);
	int a[100000];
	for(i=m;i<=n;i++){
		a[i]=yin(i);
	}
	for(i=m;i<=n;i++){
		for(j=m;j<=n;j++){
			if(i!=j){
				if(i==a[j]&&j==a[i]){
						printf("%d %d\n",i,j);
				}
			}
		
		}
	} 
	
} 

Double click to view unformatted code.


Back to problem 93