khannpro @ 2023-10-16 16:23:59
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,x,t,j,sum1;
cin>>a>>b;
for(int i=a;i<=b;i++)//先判断回文
{
x=i;
int sum=0;
while(x>0)
{
t=x%10;
sum=sum*10;
sum=sum+t;
x=x/10;
}
if(sum==i && sum%2!=0)//判断质数
{
sum1=sqrt(sum);
for(j=2;j<=sum1;j++)
{
if(sum%j==0)
{
break;
}
}
if(j>sum1)
{
cout<<sum<<endl;
}
}
}
}