| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157831 | 孔声豪 | 寻找绝对素数 | C++ | Wrong Answer | 14 MS | 268 KB | 459 | 2026-08-18 13:43:55 |
#include<bits/stdc++.h> using namespace std; bool ss(int n) { for(int i=2;i<=n/2;i++){ if(n%i==0)return false; } return true; } int fx(int n){ int m=0; while(n!=0){ m=m*10+n%10; n/=10; } return m; } int main(){ int m,n,c=0; cin>>m>>n; for(int i=m;i<=n;i++){ if(ss(i)&&ss(fx(i))){ c++; if(c==1)cout<<i; else cout<<','<<i; } } if(c==0)cout<<"No"; return 0; }
------Input------
1 10
------Answer-----
2,3,5,7
------Your output-----
1,2,3,5,7