Пример #1
0
        static void Main(string[] args)
        {
            Circle circle = new Circle("Окружность", 5);

            Console.WriteLine(circle.Area());
            Console.WriteLine(circle.Perimetr());

            Rectangle rext = new Rectangle("Прямоугольник", 30, 40);

            Console.WriteLine(rext.Area());
            Console.WriteLine(rext.Perimetr());

            Person person = new Person();

            person.Eat();
            person.Move();
            person.Sleep();

            Tiger tiger = new Tiger();

            tiger.Eat();
            tiger.Move();
            tiger.Sleep();
            Console.ReadKey();
        }
 static void Main(string[] args)
 {
     Circle c = new Circle(5);
     Square s = new Square(10);
     Rhombus rh = new Rhombus(10, 0.785);
     Rectangle rect = new Rectangle(10, 20);
     Triangle t = new Triangle(3, 4, 5);
     Console.WriteLine(c.Area().ToString() + " " + c.Perimeter().ToString());
     Console.WriteLine(s.Area().ToString() + " " + s.Perimeter().ToString());
     Console.WriteLine(rh.Area().ToString() + " " + rh.Perimeter().ToString());
     Console.WriteLine(rect.Area().ToString() + " " + rect.Perimeter().ToString());
     Console.WriteLine(t.Area().ToString() + " " + t.Perimeter().ToString());
 }