Run ID:157829

提交时间:2026-08-18 13:40:48

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