XDYZ_N @ 2024-02-21 21:35:09
#include<bits/stdc++.h>
using namespace std;
int qw(int p){
int q=p,m=0,a=p;
while(a){
m = m*10+a%10;
a /= 10;
}
if(q==m) return 1;
else return 0;
}
int as(int m){
int a=m,w=0;
for(int i=2;i<=a-1;i++){
if(a%i==0){
return 0;
break;
}
else w++;
}
if(w == a-2) return 1;
}
int main()
{
int a,b;
cin>>a>>b;
for(int i = a;i<=b;i++)
{
if(qw(i) == 1)
{
if(as(i) == 1)
{
cout<<i<<endl;
}
}
}
return 0;
}
by XDYZ_N @ 2024-02-22 08:33:20
跪谢大佬
by lunjiahao @ 2024-02-22 09:44:28
@QWQ_HY_DFX
确实当