Using System; Namespace Test { Class Program { /// <Summary> /// Determine the prime number /// </Summary> /// <Param name = "N"> </param> /// <Returns> </returns> Static Bool Isprime ( Int N ){ Int J = ( Int ) Math. Ceiling (math. SQRT (convert. todouble (N ))); Bool Intflag = True ; For ( Int I = 1; I <= J; I ++ ){ If (N % I = 0 & (I! = 1) & (I! = N) {intflag = False ; Break ;}} Return Intflag ;} /// <Summary> /// Enter a number to determine whether the result meets the Goldbach Conjecture. /// An even number greater than 6 can represent the sum of two prime numbers. /// </Summary> /// <Param name = "N"> </param> /// <Returns> </returns> Static Bool Isgdbharish ( Int N ){ Bool ISG = False ; If (N % 2 = 0 & n> 6 ){ For (Int I = 1; I <n/2; I ++ ){ Bool B1 = isprime (I ); Bool B2 = isprime (n-I ); If (B1 & B2) {console. writeline (" {0} = {1} + {2} ", N, I, n-I); ISG = True ;}}} Return ISG ;} Static Void Main (String [] ARGs ){ ///// Prime Number Int N = 1; While (N! =-1) {console. writeline (" Enter a number: "); If (Int32.tryparse (console. Readline (), Out N )){ If (N =-1) Break ; // If (program. isprime (n )) //{ // Console. writeline ("{0} is a prime number", N ); //} // Else //{ // Console. writeline ("{0} is not a prime number", N ); //} Isgdbharish (n) ;}} console. Readline ();}}}