-->
当前位置:首页 > 题库

PROGRAMMING:Goldbach's conjecture

Luz5年前 (2021-05-10)题库534
In 1742, Christian Goldbach, an amateur mathematician in Germany, wrote a letter to Leonhard Euler, in which he gave the following conjecture (Goldbach conjecture): < br > in his letter, he gave the following conjecture (Goldbach conjecture)
Every even number greater than 4 can be written as the sum of two odd primes. For example: 8 = 3 + 5, 3 and 5 are odd primes; 20 = 3 + 17 = 7 + 13; 42 = 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23。< Now Goldbach's conjecture has not been proved to be correct. Now please prove that Goldbach's conjecture holds for all even numbers less than 1000000.
###Input:
The input contains one or more test cases. Each test case gives an even integer n, 6 < = n < 1000000. Input ends with 0.
###Output:
For each test case, the output form is n = a + B, where a and B are odd primes, and the number and operator should be separated by a space, as shown in the sample output. If the sum of more than one pair of odd primes is n, the pair with the largest B-A is chosen. If there is no such number pair, "Goldbach's projection is wrong." is output.
###Input example:
```in
eight
twenty
forty-two
0
```
###Output example:
```out
8 = 3 + 5
20 = 3 + 17
42 = 5 + 37
```






answer:If there is no answer, please comment