/*
Time:2019.11.9
Author: Goven
type:
err:
ref:
*/
#include<iostream>
#include<cmath>
using namespace std;
bool isPrime(int x) {
if (x == 1 || x == 0) return false;
int l = sqrt((double)x);
for (int i = 2; i <= l; i++) {
if (x % i == 0) {
return false;
}
}
return true;
}
int main()
{
int n, a, b, l, flag;
while (cin >> n && n) {
l = n / 2;
flag = 1;
for (int i = 3; i <= l; i += 2) {
if (isPrime(i) && isPrime(n - i)) {
printf("%d = %d + %d\n", n, i, n - i);
flag = 0;
break;
}
}
if (flag) printf("Goldbach's conjecture is wrong.\n");
}
return 0;
}
网友评论