| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132753 | 李昊宇 | 寻找绝对素数 | C++ | Accepted | 12 MS | 272 KB | 580 | 2025-10-12 11:49:06 |
#include<bits/stdc++.h> using namespace std; bool su_shu (int x) { if(x < 2){ return false; } for(int i=2;i*i<=x;i++){ if(x%i==0){ return false; } } return true; } int fan_shu(int x){ int r = 0; while(true){ int g = x%10; r = r * 10 + g; x /= 10; if (x==0){ return r; } } } int n,m; int main() { cin>>m>>n; int cnt = 0; for(int i=m; i<=n; i++) { if(su_shu(i) && su_shu(fan_shu(i))) { cnt++; if(cnt==1){ cout<<i; }else{ cout<<","<<i; } } } if(!cnt) { cout<<"No"; } return 0; }