求亲密数


#include <stdio.h>
#include <math.h>

#define NUM 500

int main(void)
{
int a,b,c,i,j;
for(a=1;a<=NUM;a++)
{
for(b=0,i=1;i<=a/2+1;i++)
{
if(a%i==0)
{
b+=i;
}
}
for(c=0,j=1;j<=b/2+1;j++)
{
if(b%j==0)
{
c+=j;
}
}
if(c==a&&b>=c)
{
printf("亲密数为:(%d,%d)\n",a,b);


}
}
}


上一篇:VMware You have an incorrect version of driver 'vmci.sys'. Try reinstalling VMware Worksta


下一篇:Java Data truncation:Incorrect datetime value: ‘xxx‘ for column ‘xxx‘ at row 1问题