Run ID:98576
提交时间:2024-11-23 11:40:40
#include<bits/stdc++.h> using namespace std; int he(int b){ if (b < 2){ return 0; } for (int i = 2;i < b;i++){ if (b % i == 0){ return 0; } } return 1; } int main(){ int n,a,b,x = 0; cin>>n; for (int j = 2;j <= n - 2;j++){ a = he(j); b = he(j + 2); if (a == 1 && b == 1){ cout<<j<<" "<<j + 2<<endl; } x++; } if (x == 0){ cout<<"No"; } return 0; }