Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157774 李沐阳 素数对 C++ Accepted 165 MS 272 KB 337 2026-08-17 14:13:54

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; bool w(int q){ int s=0; for(int i=1;i<=q;i++){ if(q%i==0) s++; } if(s>2) return false; else return true; } int main(){ int n,c=0; cin>>n; for(int i=2;i<=n-2;i++){ if(w(i)&&w(i+2)){ c++;cout<<i<<' '<<i+2<<endl; } } if(c==0)cout<<"No"<<endl; return 0; }