Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84028 游四鑫 素数对 C++ Accepted 27 MS 272 KB 322 2024-07-15 11:01:56

Tests(10/10):


Code:

# include<iostream> using namespace std; int s (int w){ for(int i=2;i<w;i++){ if(w%i==0)return 0; } return 1; } int main(){ int v=0; int w,x=0; cin>>w; for(int i=2;i<w-1;i++){ if(s(i)&&s(i+2)){ cout<<i<<' '<<i+2<<endl; x++; } } if(x==0)cout<<"No"; return 0; }