| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 77873 | 孙诗皓 | 寻找绝对素数 | C++ | Time Limit Exceeded | 1000 MS | 272 KB | 685 | 2024-06-15 16:42:53 |
#include <iostream> using namespace std; int sushu(int a) { for(int i=2;i<a;i++) { if(a%i==0) return 0; } if(a!=1) return 1; else return 0; } int fanzhuan(int b) { int t=0,c=0; while(b!=0) { t=t*10+b%10; b=b/10; } return t; } int main() { int n,m,cnt=0; cin>>n>>m; for(int i=n;i<=m;i++) { if(sushu(i)==1 && sushu(fanzhuan(i))==1) { cnt++; if(cnt==1) cout<<i; else cout<<','<<i; } } if(cnt==0) cout<<"No"; return 0; }