Using System;
namespace СиШарп
{
class Program
{
static void Main(string[] args)
{
Console.Write("N = ");
int N = int.Parse(Console.ReadLine());
Console.Write("A({0}):",N);
int[] A = new int[N];
Random RND = new Random();
for (int i = 0; i < N; i++)
{
A[i] = RND.Next(-N,N+1);
Console.Write(" {0}",A[i]);
}
for (int i = N - 1; i >= 0 && A[i] < 0; i--) ;
int L = 0, j = N;
while (j > 0)
if (A[--j] > 0) L++;
else
if (L < 2) L = 0;
else break;
for(int i = j + L + 1; i < N; i++)
A[i - L] = A[i];
Console.Write("\nA({0}):",N-L);
for (int i = 0; i < N - L; i++)
Console.Write(" {0}",A[i]);
Console.ReadKey();
}
}
}