using System.Collections.Generic;
public static int MaxSequence(int[] arr)
List<int> append = new List<int>();
for (int i = 0; i < arr.Length - 1; i++)
for (i = 0; i < arr.Length - 1; i++)
if (arr[i] + arr[i + 1] > 0)
for (int i = 0; i < arr.Length; i++)
foreach (var num in append)
Console.WriteLine(number);
public static void Main()
int[] nums = {-2, 1, -3, 4, -1, 2, 1, -5, 4, -1};