Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154766 Kevin 寻找绝对素数 C++ Accepted 13 MS 272 KB 512 2026-05-30 20:50:02

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; 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 qf(int n){ int b=n; int s=0; while(b){ s=s*10+b%10; b/=10; } return s; } int main() { int m,n; cin>>m>>n; int flag=0; 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; }