zoukankan      html  css  js  c++  java
  • 【Project Euler】7 第七题

    

    //By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

    //What is the 10 001st prime number?

    static void Main(string[] args)
            {
                int count = 0;
                for (int i = 3; i < 1000000; i++)
                {
                    int index = -1;
                    for (int j = 2; j < i; j++)
                    {
                        if (i % j != 0 && i != j)
                        {

                        }
                        else
                        {
                            index += 1;
                        }
                    }
                    if (index == -1)
                    {
                        //Console.WriteLine(i);
                        count += 1;
                    }
                    if(count==10000)
                    {
                        Console.WriteLine(i);
                    }
                }
            }

    版权声明:本文为 NoMasp柯于旺 原创文章,如需转载请联系本人。

  • 相关阅读:
    关于多态
    关于lock锁
    wait()和notify()
    多线程之间的通讯
    多线程的异步请求模式
    合理配置线程池
    自定义线程池
    Curl的毫秒超时的一个”Bug”
    Nginx正确记录post日志的方法
    NGINX的奇淫技巧 —— 5. NGINX实现金盾防火墙的功能(防CC)
  • 原文地址:https://www.cnblogs.com/NoMasp/p/4786195.html
Copyright © 2011-2022 走看看