Ejemplo n.º 1
0
 static void Step3946()
 {
     Console.WriteLine();
     Console.WriteLine("3946");
     String[] in3946 =
     {
         "1 2 3 4 1",
         "1 2 3 4 1 3 4 4 4 4",
         ""
     };
     double[] out3946 = { 2.2, 3, 0 };
     for (int i = 0; i < in3946.Length; i++)
     {
         double result = Lab07.Task3946(in3946[i]);
         Console.WriteLine("{0:F6} ({0:F6})", result, out3946[i]);
     }
 }
Ejemplo n.º 2
0
 public void Task3946Test()
 {
     Assert.AreEqual(2.2, Lab07.Task3946(new int[] { 1, 2, 3, 4, 1 }));
     Assert.AreEqual(3, Lab07.Task3946(new int[] { 1, 2, 3, 4, 1, 3, 4, 4, 4, 4 }));
     Assert.AreEqual(0, Lab07.Task3946(new int[] { }));
 }