示例#1
0
        static void Main(string[] args)
        {
            string line;

            StreamReader Reader = new StreamReader("...\\input.txt");
            List <int>   array  = new List <int>();

            while ((line = Reader.ReadLine()) != null)
            {
                array.Add(Convert.ToInt32(line));
            }
            foreach (int i in array)
            {
                Console.WriteLine(string.Join(" ", i));
            }


            Remover      newArray = new Remover(array);
            StreamWriter sw       = new StreamWriter("...\\output.txt");

            foreach (int i in newArray.Delete())
            {
                sw.Write(i + " ");
            }
            sw.Close();
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            string       line;
            StreamReader sr  = new StreamReader("input.txt");
            List <int>   mas = new List <int>();

            while ((line = sr.ReadLine()) != null)
            {
                mas.Add(Convert.ToInt32(line));
            }
            foreach (int i in mas)
            {
                Console.WriteLine(i + " ");
            }
            Remover      newArray = new Remover(mas);
            StreamWriter sw       = new StreamWriter("output.txt");

            foreach (int i in newArray.Delete())
            {
                sw.Write(i + " ");
            }
            sw.Close();
            Console.ReadLine();
        }