Run ID:164273
提交时间:2026-11-01 15:51:14
#include <bits/stdc++.h> using namespace std; int add(int x){ if(x<2) return 0; for(int i=2;i<=sqrt(x);i++){ if(x%i==0) return 0; } return 1; } int fz(int y){ int m=0; while(y!=0){ m=m*10+y%10; y/=10; } return m; } int main(){ int n,a,c=1; bool f=0; cin>>n>>a; for(int i=n;i<=a;i++){ int k=fz(i); if(add(i)&&add(k)){ if(c==1){ cout<<i; f=1; } else{ cout<<","<<i; f=1; } c++; } } if(f==0) cout<<"No"; return 0; }