http://acm.hit.edu.cn/hoj/problem/view?id=1459
Every even number greater than 4 can be written as the sum of two odd primenumbers.
#include<stdio.h>
#include<math.h>
bool pri(int n);
int main()
{
int n, i;
bool flag;
while (scanf("%d", &n) && n)
{
flag = 0;
for (i = 2; i <= n/2; i++)
{
if(pri(i) && pri(n-i))
{
flag = 1;
printf("%d = %d + %d\n", n, i, n-i);
break;
}
}
/*还没被证伪*/
/*
if (flag == 0)
printf("Goldbach's conjecture is wrong.\n");
*/
}
return 0;
}
bool pri(int n)
{
int i;
for (i = 2; i <= sqrt(n); i++)
{
if (n % i == 0)
return 0;
}
return 1;
}