Run ID:159670

提交时间:2026-09-06 14:04:15

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