| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132714 | 李昊宇 | 素数对 | C++ | Accepted | 30 MS | 276 KB | 404 | 2025-10-12 10:59:53 |
#include<bits/stdc++.h> using namespace std; bool su_shu (int x) { if(x < 2) { return false; } for(int i=2 ; i <= x-1; i++) { if(x%i==0) { return false; } } return true; } int n; int main() { cin>>n; int cnt = 0; for(int i=2; i<=n-2; i++) { if(su_shu(i) && su_shu(i+2)) { cout<<i<<" "<<i+2<<endl; cnt++; } } if(!cnt) { cout<<"No"; } return 0; }