public static void Main(String[] args) { sieve s = new sieve(); bool[] nums = s.getSieve(2000000); long total = 0; for (int i = 0; i < nums.Length; i++) { if (nums[i]) { total += i; } } Console.WriteLine(total); }
public static void Main(String[] args) { sieve s = new sieve(); bool[] nums = s.getSieve(200000); int count = 0; for (int i = 0; i < nums.Length; i++) { if (nums[i] == true) { count += 1; } if (count == 10001) { Console.WriteLine(i); break; } } }