Ejemplo n.º 1
0
        public static void caseSplitter()
        {
            var inputFile =
                @"3
3 3
G??
?C?
??J
3 4
CODE
????
?JAM
2 2
CA
KE".Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList().Skip(1);

            var output = CaseInput.SubDivideInput(inputFile.GetEnumerator());

            output.Length.Should().Be(3);
            output[0].Length.Should().Be(4);
            output[1].Length.Should().Be(4);
            output[2].Length.Should().Be(3);
            output[0][1].Should().Be("G??");
            output[1][1].Should().Be("CODE");
            output[2][1].Should().Be("CA");
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            var lines   = InOut.ReadStringInput(out numberOfCases).ToList();
            var cases   = CaseInput.SubDivideInput(lines.GetEnumerator());
            var results = new List <string>();

            for (int ii = 0; ii < numberOfCases; ii++)
            {
                var parsedCase = new CaseInput(cases[ii]);
                var solver     = new CaseSolver(parsedCase);
                var result     = solver.Solve();

                var resultText = result.ToString();

                results.Add(string.Format("Case #{0}: {1}", ii + 1, resultText));
            }

            InOut.WriteOutput(results);
        }