using System.Collections.Generic;
public static void Main()
List<Animal> residers = new List<Animal>();
residers.Add(new Cat(false, 4, "сэр Уильям Сэмюэль Харрис"));
residers.Add(new Cat(false, 4, "Семён Семёныч"));
residers.Add(new It(false, 2, true));
Console.WriteLine("А теперь - приветствия:");
for (int i = 0; i < residers.Count; i++)
public static void Show(Animal animal)
Console.Write("обслуга ");
Console.Write("его Величество, ");
Console.Write(cat._name);
Console.WriteLine("с " + animal._legs + "-мя ногами");
public abstract class Animal
public bool _hasFeathers;
public abstract void MakeSound();
public virtual void GreetCat()
Console.WriteLine("Приветствую тебя, о Кот, во всем твоем великолепии");
public It(bool hasFeathers, int legs, bool hasNails)
_hasFeathers = hasFeathers;
public override void MakeSound() { Console.WriteLine("Вы ж только поели"); }
public Cat(bool hasFeathers, int legs, string name)
_hasFeathers = hasFeathers;
public override void MakeSound()
Console.Write(" говорит: ");
Console.WriteLine("'Дай еды'.");
public override void GreetCat()
Console.WriteLine("Здоров вам от " + _name);