Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96115 黎瑾萱 哥德巴赫猜想 C++ Accepted 2 MS 260 KB 315 2024-11-03 09:13:31

Tests(1/1):


Code:

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