| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 164838 | 颜学俊逸 | 素数对 | C++ | Wrong Answer | 1 MS | 260 KB | 391 | 2026-11-07 15:35:52 |
#include<bits/stdc++.h> using namespace std; bool isss(int k){ if(k == 1) return 0 ; for(int i = 2;i <= sqrt(k);i++){ if(k % i == 0)return 0; } return 1; } int main(){ int x,f = 0; cin >> x; for(int i = 2;i <= x - 2;i++){ if(isss(i) && isss(i + 2)){ cout << i << " " << i + 2 <<endl; f = 1; } if(f == 0){ cout << "No"; } } return 0; }
------Input------
17
------Answer-----
3 5 5 7 11 13
------Your output-----
No3 5 5 7 11 13