Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154163 唐诗阳 素数对 C++ Accepted 13 MS 272 KB 578 2026-05-24 15:53:43

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() int z(int n){ for(int i=2;i<=n/2;i++){ if(n%i==0) return 0; } return 1; } using namespace std; int main(){ int n,e=0; cin>>n; for(int i=2;i<=n;i++){ if(z(i)==1 && z(i+2)==1 && i+2<=n) cout<<i<<' '<<i+2<<endl; e=1; } if(e==0) cout<<"No"; return 0; }