Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84226 刘宇轩 哥德巴赫猜想 C++ Accepted 1 MS 256 KB 366 2024-07-15 14:29:04

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int a(int b){ for(int i=2;i<=sqrt(b);i++){ if(b%i==0){ return 0; } } return 1; } 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(a(j)==1&&a(k)==1){ cout<<i<<"="<<j<<"+"<<k<<endl; break; } } } return 0; }