using System; public class Test { public static void Main() { int[] data = new int[] { 1, 2, 0, 3, 4, 5, 6, 7, 0, 8, 9 }; bool is_multiplied = false; long result = 0; int index = 0; while (index < data.Length) { if (data[index] == 0) { is_multiplied = !is_multiplied; if (!is_multiplied) { break; } result = 1; } else { if (is_multiplied) { result *= data[index]; } } index++; } Console.WriteLine(result); } }