using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoetheOfArithmetic
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个大于6的偶数:");
            int intNum = Convert.ToInt32(Console.ReadLine());
            bool blFlag = ISGDBHArith(intNum);
            if (blFlag)
            {
                Console.WriteLine("{0}能写成两个素数的和,所以其符合哥德巴赫猜想。", intNum);
            }
            else
            {
                Console.WriteLine("猜想错误");
            }
            Console.ReadLine();
        }

        static bool ISGDBHArith(int intNum)
        {
            bool blFlag = false;
             ==  && intNum > )
            {
                ; i < intNum / ; i++)
                {
                    bool bl1 = IsPrimeNumber(i);
                    bool bl2 = IsPrimeNumber(intNum - i);

                    if (bl1 & bl2)
                    {
                        Console.WriteLine("{0}={1}+{2}", intNum, i, intNum - i);
                        blFlag = true;
                    }
                }
            }

            return blFlag;
        }

        static bool IsPrimeNumber(int intNum)
        {
            bool blFlag = true;
             || intNum == )
            {
                blFlag = true;
            }
            else
            {
                int sqr = Convert.ToInt32(Math.Sqrt(intNum));
                ; i--)
                {
                    )
                    {
                        blFlag = false;
                    }
                }
            }
            return blFlag;
        }
    }
}

最新文章

  1. PHP文件相关的操作函数——文件操作
  2. AS 重装系统之后配置
  3. 用maven搭建 testNG+PowerMock+Mockito测试框架
  4. C primer plus 练习题 第六章
  5. js上传图片预览
  6. SSL证书请求文件(CSR)生成指南 - Tomcat
  7. Ubuntu 14.10 下Ganglia监控Spark集群
  8. for语句中声明变量
  9. Cocos2d-x实例:设置背景音乐与音效-HelloWorld场景实现
  10. Comparator和Comparable
  11. 锁和监视器之间的区别 – Java并发
  12. Xshell Linux 主要命令
  13. JDK1.8下载与安装及环境变量配置
  14. man sm-notify(sm-notify命令中文手册)
  15. h5笔记02
  16. requests 使用免费的代理ip爬取网站
  17. C#集合类型大揭秘
  18. FileZilla建立服务器,命令行客户端
  19. 【转】keil5 missing close quote 错误解决
  20. 微信小程序插件内页面跳转和参数传递(转)

热门文章

  1. org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launch IE
  2. 【原】iOS学习之应用之间的操作
  3. PHPer不能不看的50个细节!
  4. 使用IHTMLDocument2解决弹出&quot;为了让该网站给你提供个人化信息,是否允许在你计算机放置cookie?&quot;
  5. 树形DP
  6. Shader实例:序列帧动画
  7. 【ORACLE】字符串操作 B字符串时A的一部分
  8. tomcat -ROOT 与webapps 的关系,关于部署的一些问题
  9. ts 协议解析
  10. 无法连接虚拟设别 ide1:0.