| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 156085 | 郑雨心 | 寻找绝对素数 | C++ | Accepted | 14 MS | 268 KB | 523 | 2026-06-21 19:28:44 |
#include<iostream> #include<cmath> using namespace std; int qf(int n) { int s=0; int t=n; while(t){ s=s*10+t%10; t/=10; } return s; } bool ss(int n) { if(n==1) return false; for(int i=2;i<=sqrt(n);i++) { if(n%i==0){ return false; } } return true; } int main(){ int m,n,flag=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(ss(i)&&ss(qf(i))){ flag++; if(flag==1){ cout<<i; } else{ cout<<','<<i; } } } if(flag==0) cout<<"No"; return 0; }