Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158984 刘杨国卿 素数对 C++ Accepted 26 MS 276 KB 371 2026-08-24 12:41:56

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; bool l(int m){ for(int i=2;i<m;i++){ if(m%i==0){ return false; } } return true; } int main(){ int n; cin>>n; int fw=1; bool f=true; for(int i=2;i<=n;i++){ if(l(i)){ if(fw+2==i){ cout<<fw<<" "<<i<<endl; f=false; } fw=i; } } if(f){ cout<<"No"; } return 0; }