示例#1
0
        public static void Main(string[] args)
        {
            int radius = int.Parse(Console.ReadLine());
            int width  = int.Parse(Console.ReadLine());
            int height = int.Parse(Console.ReadLine());

            Circle circle = new Circle(radius);

            circle.Print();

            Rectangle rectangle = new Rectangle(width, height);

            rectangle.Print();
        }
示例#2
0
        static void Main(string[] args)
        {
            List <Shape> shapes = new List <Shape>();

            Shape triangle = new Triangle(6, 5);

            shapes.Add(triangle);

            triangle.Print();

            Shape rectangle = new Rectangle(4, 8);

            shapes.Add(rectangle);

            rectangle.Print();

            Shape square = new Square(4);

            shapes.Add(square);

            square.Print();
        }