示例#1
0
        public override string SecondStar()
        {
            var input  = RemoveWhitespace(ReadLineInput());
            var result = new SpreadSheet(input).SumEvenDivisable;

            return(result.ToString());
        }
示例#2
0
        public override string FirstStar()
        {
            var input  = RemoveWhitespace(ReadLineInput());
            var result = new SpreadSheet(input).Checksum;

            return(result.ToString());
        }
示例#3
0
        public void FirstStarExample()
        {
            var input = new[]
            {
                "5 1 9 5",
                "7 5 3",
                "2 4 6 8"
            };

            var checksum = new SpreadSheet(input).Checksum;

            Assert.Equal(8 + 4 + 6, checksum);
        }
示例#4
0
        public void SecondStarExample()
        {
            var input = new[]
            {
                "5 9 2 8",
                "9 4 7 3",
                "3 8 6 5"
            };

            var sumOfEvenDivisable = new SpreadSheet(input).SumEvenDivisable;

            Assert.Equal(8 / 2 + 9 / 3 + 6 / 3, sumOfEvenDivisable);
        }