Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67494 游四鑫 素数对 C++ Wrong Answer 0 MS 272 KB 316 2024-03-16 16:25:56

Tests(0/10):


Code:

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


Run Info:

------Input------
17
------Answer-----
3 5 5 7 11 13
------Your output-----
2 43 54 65 76 87 98 109 1110 1211 1312 1413 1514 16