Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84241 张黄源 哥德巴赫猜想 C++ Accepted 2 MS 260 KB 356 2024-07-15 14:39:02

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; bool s(int a) { for(int j=2; j<=sqrt(a); j++) { if(a%j==0) { return false; } } return true; } int main() { int k; for(int i=6; i<=100; i=i+2) { for(int j=3; j<=i/2; j=j+2) { k=i-j; if(s(j)&&s(k)) { cout<<i<<'='<<j<<'+'<<k<<endl; break; } } } return 0; }