Run ID:157832

提交时间:2026-08-18 13:45:55

#include<bits/stdc++.h> using namespace std; bool sushu(int q){ if(q<2) return false; for(int i=2;i<=q/2;i++){ if(q%i==0) return false; } return true; } int fx(int q){ int t=0; while(q!=0){ t=t*10+q%10; q/=10; } return t; } int main(){ int n,m,r,t=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(sushu(i)&&sushu(fx(i))){ t++; if(t==1) cout<<i; else cout<<','<<i; } } if(t==0) cout<<"No"<<endl; return 0; }