Exemplo n.º 1
0
        public static void RunProblem(IProblem problem)
        {
            Console.WriteLine(problem.GetProblemDescription());
            Console.WriteLine();

            var stopwatch = new Stopwatch();
            stopwatch.Start();

            var result = problem.Solve();
            stopwatch.Stop();

            Console.WriteLine("Solution to problem {0}: {1}", problem.GetProblemNumber(), result);
            Console.WriteLine("Problem solved in {0}", stopwatch.Elapsed);
        }