证明哥德巴赫猜想的计算机程序

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 23:46:34
证明哥德巴赫猜想的计算机程序

证明哥德巴赫猜想的计算机程序
证明哥德巴赫猜想的计算机程序

证明哥德巴赫猜想的计算机程序
是不可能的
因为哥德巴赫猜想的大偶数是无限多的
一个计算机程序 它的运行必须是有限的才能运行这个程序
不过 要证明有限大的时候哥德巴赫猜想成立的计算机程序还是有的

c++ 验证如下:
#include
using namespace std;
#define max 1000
bool prime(int x){
if (x==1)return false;
if (x==2 || x==3)return true;
for (int i=3;i*i<=x;i+=2){
if...

全部展开

c++ 验证如下:
#include
using namespace std;
#define max 1000
bool prime(int x){
if (x==1)return false;
if (x==2 || x==3)return true;
for (int i=3;i*i<=x;i+=2){
if (x%i==0)return false;
}
return true;
}
void main(){
for (int i=2;i<=max;i+=2)
for (int j=2;j if(prime(j) && prime(i-j)){
cout< break;
}
}

收起