using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { delegate void MyDelegate(string s); interface NameGorerment { void PrintName(); } interface President { void PrintPresident(); } interface Monach { void PrintTheMonarchy(); } class Goverment : NameGorerment { public string Name; public Goverment(string name) { this.Name = name; } public void PrintName() { Console.WriteLine(this.Name); } } class Republic : Goverment,NameGorerment,President { public string President; public Republic(string name, string president) : base(name) { this.President = president; } public void PrintPresident() { Console.WriteLine(this.President); } } class TheMonarchy : Goverment,NameGorerment,Monach { public string Monarch; public TheMonarchy(string name, string monarch) : base(name) { this.Monarch = monarch; } public void PrintTheMonarchy() { Console.WriteLine(this.Monarch); } } class Kingdom : TheMonarchy, NameGorerment, Monach { public string NameKingdom; public Kingdom(string name, string monarch, string namekingdom) : base(name, monarch) { this.NameKingdom = namekingdom; } public void PrintNameKingdom() { Console.WriteLine(this.NameKingdom); } } class Program { static void Main(string[] args) { Goverment UK = new Goverment("UK"); UK.PrintName(); Console.WriteLine("\n"); TheMonarchy Elizabet = new TheMonarchy("UK", "Elizabet"); Elizabet.PrintTheMonarchy(); Console.WriteLine("\n"); Kingdom Britan = new Kingdom("UK", "Elizabet", "Britan"); Britan.PrintNameKingdom(); Console.WriteLine("\n"); Goverment Ukrain = new Goverment("Ukrain"); Ukrain.PrintName(); Console.WriteLine("\n"); Republic President = new Republic("Ukrain", "Poroshenko"); President.PrintPresident(); Console.WriteLine("\n"); Console.ReadKey(); } } }