コード例 #1
0
        static void Main(string[] args)
        {
            var family = new Family();

            int count = int.Parse(Console.ReadLine());

            for (int i = 0; i < count; i++)
            {
                string[] personInfo = Console.ReadLine().Split();
                string   name       = personInfo[0];
                int      age        = int.Parse(personInfo[1]);

                var person = new Person(name, age);

                family.AddMember(person);
            }

            var peopleMoreThan30 = family.GetMoreThen30();

            foreach (var person in peopleMoreThan30)
            {
                Console.WriteLine($"{person.Name} - {person.Age}");
            }
        }