#include
#include
int fun(int x) ;
int main()
{
int hat ;
printf("请输入想要多少对亲密数") ;
scanf("%d",&hat) ;
int *that1=new int [hat] ;
int *that2=new int [hat] ;
int a,j,b ;
int top=0 ;
for(a=3;;a++)
{
b=fun(a) ;
if(a==b)
continue ;
if(a==fun(b))
{
that1[top]=a ;
that2[top]=b ;
printf("%d%dn",a,b) ;
top++ ;
if(top%1000==0)
printf("%dn",top) ;
if(top>hat)
break ;
}
}
FILE *fp=fopen("D:\亲密数.txt","w");
for(int i=0;i