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

            for (int i = 0; i < n; i++)
            {
                string[] input = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);
                string   name  = input[0];
                int      age   = int.Parse(input[1]);

                family.AddMember(new Person(name, age));
            }

            Person oldestMember = family.GetOldetsMember();

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