Esempio n. 1
0
        public static void Main(string[] args)
        {
            BinaryTree myTree = new BinaryTree ();
            using (StreamReader fileIn = new StreamReader ("/Users/masha/Documents/ssu/c_sharp/Pr15R1ex5/Pr15R1ex5/input.txt"))
            {

                string line = fileIn.ReadToEnd ();
                string[] mas = line.Split (' ');

                foreach (string item in mas)
                    myTree.Add (int.Parse(item));

                int sum = 0;
                sum += Convert.ToInt32(myTree.Walk(myTree.Tree));

                Console.WriteLine ("{0}",sum);
            }
        }