static Portal_() { _countries[0] = new England(); _countries[1] = new France(); _countries[2] = new Germany(); _countries[3] = new Spain(); _countries[4] = new Ukraine(); }
static void testStaticConstruct() { var fr = new France(); var fr2 = new France(); // France.Population += 1.0; //-- ERROR readonly System.Console.WriteLine(France.Population); }
static void Main(string[] args) { ICountry france = new France(); Console.WriteLine(france.getHelloMessage()); ICountry unitedKingdom = new UnitedKingdom(); Console.WriteLine(unitedKingdom.getHelloMessage()); ICountry unitedStatesOfAmerica = new UnitedStatesOfAmerica(); Console.WriteLine(unitedStatesOfAmerica.getHelloMessage()); ICountry indonesia = new Indonesia(); Console.WriteLine(indonesia.getHelloMessage()); Console.ReadLine(); }
static void Main(string[] args) { Russia c1 = new Russia(); c1.Prn(); USA c2 = new USA(); c2.Prn(); France c3 = new France(); c3.Prn(); double p1, p2, p3; p1 = c1.GetPopolation(); p2 = c2.GetPopolation(); p3 = c3.GetPopolation(); double max; max = 0; if (p1 > p2 && p1 > p3) { max = p1; Console.WriteLine($"Столица с наибольшим населением - {max} - Москва"); } if (p2 > p1 && p2 > p3) { max = p2; Console.WriteLine($"Столица с наибольшим населением - {max} - Вашингтон"); } if (p3 > p2 && p3 > p1) { max = p3; Console.WriteLine($"Столица с наибольшим населением - {max} - Париж"); } }