static void Main(string[] args) { //List<int> list = new List<int>() { 1, 3, 5 }; //Cowotainer cowo1 = new Cowotainer(list); //list = new List<int>() { 3, 3, 2 }; //Cowotainer cowo2 = new Cowotainer(list); //cowo1.Show(); //cowo2.Show(); //Cowotainer cowo3 = cowo1 * cowo2; //cowo3.Show(); int[] a = new int[] { 1, 2, 6, 4, 8 }; Massive.Sorty(a); Massive.Show(a); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Введите размер массива"); if (!(Int32.TryParse(Console.ReadLine(), out int n))) { Console.WriteLine("Ошибка ввода"); Console.ReadKey(); return; } int[] rand = Massive.GetRandomMassive(n, -10, 10); Massive.SeeMassive(rand); int summ = 0; foreach (int i in rand) { if (i > 0) { summ += i; } } Console.WriteLine($"summ - {summ}"); Console.ReadKey(); }