static void Main(string[] args) { //using (StreamReader sr = new StreamReader("test_file.txt")) using (StreamReader sr = File.OpenText(args[0])) { string line; program a = new program(); while ((line = sr.ReadLine()) != null) { Console.WriteLine(a.findAnswer(line)); } } Console.Read(); }
static void Main(string[] args) { //using (StreamReader sr = new StreamReader("test_file.txt")) using (StreamReader sr = File.OpenText(args[0])) { string line; int output; program a = new program(); while ((line = sr.ReadLine()) != null) { line = line.Trim(); if (line.Length > 0) { output = a.findAnswer(line); Console.WriteLine(output); } } } Console.Read(); }