#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
main()
{
int i, j, s1, s2, n = 3000;
for (j = 2; j <= n; j++)
{
s1 = 1; //保证每次循环i的初值为1
for (i = 2; i <= j / 2; i++)
if (j % i == 0) //判断i是否为j的因子
s1 += i;
s2 = 1; //保证每次循环i的初值为1
for (i = 2; i <= s1 / 2; i++)
if (s1 % i == 0) //判断i是否为s1的因子
s2 += i;
if (s2 == j &&s1 > j)printf("%d -- %d\n",j,s1);
}
}
标签:SECURE,CRT,NO,s1,亲密,main
From: https://www.cnblogs.com/258-333/p/17421681.html