| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 164811 | 杜禹轩 | 素数对 | C++ | Wrong Answer | 1 MS | 264 KB | 317 | 2026-11-07 15:22:04 |
#include<bits/stdc++.h> using namespace std; bool q(int s){ if(s==1){ return 0; } for(int i=2;i<=sqrt(s);i++){ if(s%i==0){ return 0; } } return 1; } int main(){ long long n; cin>>n; for(int i=2;i<=n;i++){ if(q(i)&&q(i+2)){ cout<<i<<" "<<i+2<<endl; } } return 0; }
------Input------
17
------Answer-----
3 5 5 7 11 13
------Your output-----
3 5 5 7 11 13 17 19