Run ID:154187

提交时间:2026-05-24 16:26:57

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int z(int x){ if(x<2)return 0; for(int i=2;i<=x/2;i++){ if(x%i==0){ return 0; } } return 1; } int fz(int y){ int f=0; while(y!=0){ f=f*10+y%10; y/=10; } return z(f); } int main(){ int m,n,s=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(z(i)&&fz(i)){ if(s) cout<<","<<i; else cout<<i; s++; } } if(s==0){ cout<<"No"; } return 0; }