示例#1
0
        static void Main(string[] args)
        {
            List <Client> CatalogClients = new List <Client>();
            int           count          = 1;

            while (count != 0)
            {
                Client client = new Client();
                client.GetInfo();
                CatalogClients.Add(client);
                Console.WriteLine("Enter number: ");
                count = Convert.ToInt32(Console.ReadLine());
            }

            foreach (Client client in CatalogClients)
            {
                if (client.Name == "Zakhar")
                {
                    Console.WriteLine("Name: {0}, Surname: {1}, Age: {2}", client.Name, client.Surname, client.Age);
                }
            }
        }