static void Main(string[] args) { List <int> array = new List <int>() { 4, 3, 4, 5, -1, -2, -3, 2 }; Console.WriteLine("Исходный массив: "); foreach (int item in array) { Console.Write(item.ToString() + " "); } Console.WriteLine(); DeletingFromArray output = new DeletingFromArray(); List <DeletingFromArray> deleting = output.ToDeleting(array: array); Console.WriteLine(); Console.WriteLine("Результат: "); foreach (int item in array) { Console.Write(item.ToString() + " "); } Console.WriteLine(); Console.ReadLine(); }
static void Main(string[] args) { string line; StreamReader Reader = new StreamReader("...\\Elements.txt"); List <int> array = new List <int>(); while ((line = Reader.ReadLine()) != null) { array.Add(Convert.ToInt32(line)); } DeletingFromArray delete = new DeletingFromArray(array); StreamWriter Writer = new StreamWriter("...\\Result.txt"); foreach (int i in delete.DeleteToArray(array)) { Writer.Write(i + " "); } Writer.Close(); }