| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 151660 | Kevin | 素数 | C++ | Accepted | 30 MS | 264 KB | 440 | 2026-04-17 10:47:12 |
#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 main(){ int n; while(cin>>n){ int flag=0,zz=0; for(int i=2;i<n;i++){ if(ss(i)&&(i%10==1)){ flag=1; zz++; if(zz==1){ cout<<i; } else cout<<" "<<i; } } if(flag==0) cout<<-1; cout<<endl; } return 0; }