大一0基础小白用最基础C写哥德巴赫猜想

#include <stdio.h>
int main (){

int a,b,c,k,count1,count2;

for(a=4;a<=1200;a=a+2){

for(b=2;b<=a/2;b++){
count1=0;
for(c=2;c<=b-1;c++){
if(b%c==0)
count1++;}
if(count1==0){
k=a-b;
count2=0;
for(c=2;c<=k-1;c++){
if(k%c==0)
count2++;
}
if(count2==0){
printf("%d=%d+%d\n",a,b,k);
break;
}

}

}

}

}











 

posted @ 2019-10-13 10:13  Codenewbie  阅读(308)  评论(0编辑  收藏  举报