using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void znaki(int[] a) { //Массив до изменений этот код можно удалить //Выводит весь массив со всеми значениями for (int i = 0; i < a.Length; i++) { Console.Write(a[i]+" "); } Console.WriteLine(); // for (int r = 0; r < a.Length-1; r++) { if (a[r] >= 0) { if (a[r + 1] <= 0) { Console.WriteLine("Пара: "+a[r]+" " +a[r+1]); } } if (a[r] <= 0) { if (a[r + 1] >= 0) { Console.WriteLine("Пара: " + a[r] +" " + a[r + 1]); } } } } static void Main(string[] args) { Console.WriteLine("введите количество элементов в массиве:"); int n = Convert.ToInt32(Console.ReadLine()); int[] a = new int[n]; Random rand = new Random(); for (int i = 0; i < a.Length; i++) { a[i] = rand.Next(-10,10); } znaki(a); Console.ReadLine(); } } }