using System; using System.Collections.Generic; using System.Linq; namespace EratosthenesCS { class Program { readonly static int N = 5000000; static List SieveOfEratosthenes(int n) { bool[] isPrime = Enumerable.Repeat(true, n).ToArray(); var primes = new List(); isPrime[0] = isPrime[1] = false; for (int i = 2; i < n; i++) { if (isPrime[i]) { primes.Add(i); for (int j = 2 * i; j < n; j += i) { isPrime[j] = false; } } } return primes; } static void Main(string[] args) { var _ = SieveOfEratosthenes(N); Console.WriteLine(0); } } }