Пример #1
0
 public void Task4283Test()
 {
     Assert.AreEqual(1, Lab07.Task4283(3, new int[] { 1, 2, 3, 4, 1, 2 }));
     Assert.AreEqual(0, Lab07.Task4283(5, new int[] { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3 }));
     Assert.AreEqual(5, Lab07.Task4283(2, new int[] { 3, 2, 2, 2, 2, 2 }));
     Assert.AreEqual(0, Lab07.Task4283(1, new int[] { 4, 4, 4, 4, 4, 4 }));
 }
 static void Step4283()
 {
     Console.WriteLine();
     Console.WriteLine("4283");
     int[]    in4283k = { 3, 5, 2, 1 };
     String[] in4283s =
     {
         "1 2 3 4 1 2",
         "1 2 3 4 1 2 3 4 1 2 3",
         "3 2 2 2 2 2",
         "4 4 4 4 4 4"
     };
     int[] out4283 = { 1, 0, 5, 0 };
     for (int i = 0; i < in4283k.Length; i++)
     {
         int result = Lab07.Task4283(in4283k[i], in4283s[i]);
         Console.WriteLine("{0} ({1})", result, out4283[i]);
     }
 }