#include<stdio.h>
main()
{
long int a;
while(scanf("%ld",&a)!=EOF)
{
long int i=2,j=0,k=0,p=0,h,v=a;
while(a>i)
{
if(a%i==0)
{
j++;
}
i++;
if(j==1)
break;
}
if(j==1)
printf("%ld is not prime.\n",a);
else
{
while(a!=0)
{
i=a%10;
a=a/10;
p=(p*10)+i;
}
i=2,k=0;
while(p>i)
{
if(p%i==0)
{
k++;
}
i++;
if(k==1)
break;
}
if(v==p)printf("%ld is prime.\n",v);
else if(k==1)
printf("%ld is prime.\n",v);
else
printf("%ld is emirp.\n",v);
}
}
}
main()
{
long int a;
while(scanf("%ld",&a)!=EOF)
{
long int i=2,j=0,k=0,p=0,h,v=a;
while(a>i)
{
if(a%i==0)
{
j++;
}
i++;
if(j==1)
break;
}
if(j==1)
printf("%ld is not prime.\n",a);
else
{
while(a!=0)
{
i=a%10;
a=a/10;
p=(p*10)+i;
}
i=2,k=0;
while(p>i)
{
if(p%i==0)
{
k++;
}
i++;
if(k==1)
break;
}
if(v==p)printf("%ld is prime.\n",v);
else if(k==1)
printf("%ld is prime.\n",v);
else
printf("%ld is emirp.\n",v);
}
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন