Exemple #1
0
        static void Main(string[] args)
        {
            int    n      = int.Parse(Console.ReadLine());
            Family family = new Family();

            for (int i = 0; i < n; i++)
            {
                string[] personInfo = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);
                string   name       = personInfo[0];
                int      age        = int.Parse(personInfo[1]);
                Person   currPerson = new Person(name, age);
                family.AddMember(currPerson);
            }

            Person oldestPerson = family.GetOldestGetOldestMember();

            Console.WriteLine($"{oldestPerson.Name} {oldestPerson.Age}");
        }