using System; public class Test { class Pet { public string Name; // имя питомца public int Legs; // количество ног питомца public string Voice; // голос питомца public static int TotalLegs; // общее количество ног питомца public void WhoAreYou() { Console.Write("What is your pet`s name? "); Name = Console.ReadLine(); Console.WriteLine(Name); Console.WriteLine("How many legs does it have? "); Legs = int.Parse(Console.ReadLine()); Console.WriteLine("What does it say? "); Voice = Console.ReadLine(); TotalLegs += Legs; } } public static void Main() { Pet myPet1 = new Pet(); myPet1.WhoAreYou(); Pet myPet2 = new Pet(); myPet2.WhoAreYou(); Pet myPet3 = new Pet(); myPet3.WhoAreYou(); Console.WriteLine("They have {0} legs.", Pet.TotalLegs); } }