#define MAX (1000000 + 10) bool bPrime[MAX]; void InitPrime() { memset(bPrime, true, sizeof(bPrime)); bPrime[0] = bPrime[1] = false; for (int i = 2; i <= MAX; ++i) { if (bPrime[i]) for (int j = 2 * i; j <= MAX; j += i) { bPrime[j] = false; } } }
int main() { int nN;
InitPrime(); while (scanf("%d", &nN), nN) { int i; for (i = 2; i < nN; ++i) { if (i % 2 && (nN - i) % 2 && bPrime[i] && bPrime[nN - i]) { printf("%d = %d + %d\n", nN, i, nN - i); break; } } if (i == nN) { printf("Goldbach's conjecture is wrong.\n"); } }