static void Main(string[] args) { Primes p = new Primes(); using (StreamReader reader = File.OpenText(args[0])) while (!reader.EndOfStream) { string line = reader.ReadLine(); if (line == null) continue; int[] range = line.Split(',').Select(x => int.Parse(x)).ToArray(); Console.WriteLine(p.GetPrimeCount(range)); } }