| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132756 | 王金檐 | 寻找绝对素数 | C++ | Wrong Answer | 2 MS | 268 KB | 559 | 2025-10-12 11:52:32 |
#include<bits/stdc++.h> using namespace std; int a,p; int dx (int i){ a=0; p=i; while(p>0){ int g=p%10; a=a*10+g; p/=10; } return a; } bool zs (int i){ for(int l=1;l*l<=i;l++){ if(l!=1){ if(i%l==0){ return 0; } } } return 1; } int n,m,cut=0,jb=0; int main(){ cin>>n>>m; for(int i=n;i<=m;i++){ if(zs(i)==1){ if(zs(dx(i))==1){ if(jb==0){ cout<<i; jb++; cut++; }else{ cout<<","<<i; } } } } if(cut==0){ cout<<"No"; } return 0; }
------Input------
1 10
------Answer-----
2,3,5,7
------Your output-----
1,2,3,5,7