using System;
using System.Linq;
namespace Prog
{
public class Program
public static void Main(string[] args)
Random rnd = new Random();
int len = rnd.Next(5,30);
int[] A = new int[len];
for (int i = 0; i < len; i++)
A[i] = rnd.Next(-50, 50);
Console.WriteLine("{0}", string.Join(" ", A));
var B = Array.FindAll(A, i => i >= A[Array.IndexOf(A, A.Max())-1]);
foreach (int i in B)
Console.Write(i+" ");
}
using System;
using System.Linq;
namespace Prog
{
public class Program
{
public static void Main(string[] args)
{
Random rnd = new Random();
int len = rnd.Next(5,30);
int[] A = new int[len];
for (int i = 0; i < len; i++)
A[i] = rnd.Next(-50, 50);
Console.WriteLine("{0}", string.Join(" ", A));
var B = Array.FindAll(A, i => i >= A[Array.IndexOf(A, A.Max())-1]);
foreach (int i in B)
Console.Write(i+" ");
}
}
}