예제 #1
0
        static void Main(string[] args)
        {
            SieveofEratosthenes Engine = new SieveofEratosthenes(121);

            Engine.InitializeSieve();
            foreach (var a in Engine.ListPrimeNumber)
            {
                Console.WriteLine(a);
            }
            Console.ReadLine();
        }
예제 #2
0
        static void PrimeNumbers()
        {
            bool[] result;

            SieveofEratosthenes sol = new SieveofEratosthenes();

            result = sol.solution(1000);

            for (int i = 0; i < result.Length; i++)
            {
                if (result[i])
                {
                    WriteLine($"{i}");
                }
            }
        }