static void Main(string[] args) { Data data = new Data(); int[] array = data.DataEntry(); Arithmetic a = new Arithmetic(); array = a.InsertInArray(array); Console.Write("Массив после вставки: "); for (int i = 0; i < array.Length; i++) { Console.Write(" " + array[i]); } Console.ReadLine(); }
public int[] NewArray(int[] array) { Arithmetic a = new Arithmetic(); int average = a.arithmetic(array); int index = 0; for (int i = 0; i < array.Length; i++) { if (Math.Abs(array[i]) > average) { index++; } } int[] result = new int[array.Length + index]; return(result); }