public static void Main() { Shape shape; var input = Console.ReadLine(); if (input == "Square") { shape = new Square(int.Parse(Console.ReadLine())); } else { shape = new Rectangle(int.Parse(Console.ReadLine()), int.Parse(Console.ReadLine())); } var corDraw = new CorDraw(shape); corDraw.Draw(); }
public static void Main() { var shape = Console.ReadLine(); var width = double.Parse(Console.ReadLine()); double height; if (shape == "Square") { height = width; } else { height = double.Parse(Console.ReadLine()); } var figure = new CorDraw(width, height); Console.WriteLine(figure.Draw()); }