示例#1
0
        public static void sumFactor()
        {
            Console.WriteLine("test for sumFactor ");
            Console.WriteLine("========================");

            Console.Write("array {1, -1, 1, -1, 1, -1, 1} is"); Console.WriteLine(" = {0}"
                                                                                  , TestSet3.sumFactor(new int[] { 1, -1, 1, -1, 1, -1, 1 }));

            Console.Write("array {1, 2, 3, 4} is"); Console.WriteLine(" = {0}"
                                                                      , TestSet3.sumFactor(new int[] { 1, 2, 3, 4 }));

            Console.Write("array {3, 0, 2, -5, 0} is"); Console.WriteLine(" = {0}"
                                                                          , TestSet3.sumFactor(new int[] { 3, 0, 2, -5, 0 }));

            Console.Write("array {9, -3, -3, -1, -1} is"); Console.WriteLine(" = {0}"
                                                                             , TestSet3.sumFactor(new int[] { 9, -3, -3, -1, -1 }));

            Console.Write("array {1} is"); Console.WriteLine(" = {0}"
                                                             , TestSet3.sumFactor(new int[] { 1 }));

            Console.Write("array {0, 0, 0} is"); Console.WriteLine(" = {0}"
                                                                   , TestSet3.sumFactor(new int[] { 0, 0, 0 }));

            Console.WriteLine("========================");
        }