Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157829 张蔚林 寻找绝对素数 C++ Accepted 810 MS 272 KB 451 2026-08-18 13:40:48

Tests(10/10):


Code:

#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; }