Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
87735 冯诚阳 哥德巴赫猜想 C++ Accepted 2 MS 264 KB 422 2024-08-11 19:32:26

Tests(1/1):


Code:

#include<iostream> #include<string> using namespace std; bool f(int x){ for(int i=2;i*i<=x;i++) if(x%i==0) return false; return true; } int main() { for(int i=6;i<=100;i+=2){ for(int j=3;j<=i/2;j++){ if(f(j)&&f(i-j)&&i-j>2){ cout<<i<<"="<<j<<"+"<<i-j<<endl; break; } } } return 0; }