static void Main(string[] args) { TextReader tr = new StreamReader(@"C:\Google Code Jam\A-small-attempt3.in"); TextWriter tw = new StreamWriter(@"C:\Google Code Jam\A-small-attempt3.txt"); ProblemA.Solve(tr, tw); tr.Close(); tw.Close(); Console.ReadKey(); }
public static void Solve(TextReader tr, TextWriter tw) { int L = int.Parse(tr.ReadLine()); for (int i = 1; i <= L; i++) { ProblemA problem = new ProblemA(tr.ReadLine().Trim()); Console.WriteLine("Case #{0}: {1}", i, problem.a); tw.WriteLine(String.Format("Case #{0}: ", i) + problem.Calc()); } }