#include<stdio.h> main() { int i,j,s,t; int m,n; scanf("%d%d",&m,&n); for(i=m;i<=n;i++) {s=0;t=0; for(j=1;j<=i/2;j++) if(i%j==0) s+=j; for(j=1;j<=s/2;j++) if(s%j==0) t+=j; if(t==i&&s<i) printf("%d %d\n",s,i);} } |
Double click to view unformatted code.