public static void Main() { string shape = Console.ReadLine(); int w = 0; int h = 0; switch (shape) { case "Square": { w = int.Parse(Console.ReadLine()); h = w; } break; case "Rectangle": { w = int.Parse(Console.ReadLine()); h = int.Parse(Console.ReadLine()); } break; } CorDraw sq=new CorDraw(w,h); Console.WriteLine(sq); }
public static void Main() { string shape = Console.ReadLine(); int w = 0; int h = 0; switch (shape) { case "Square": { w = int.Parse(Console.ReadLine()); h = w; } break; case "Rectangle": { w = int.Parse(Console.ReadLine()); h = int.Parse(Console.ReadLine()); } break; } CorDraw sq = new CorDraw(w, h); Console.WriteLine(sq); }
static void Main(string[] args) { string figureType = Console.ReadLine(); if (figureType == "Square") { int number = int.Parse(Console.ReadLine()); Square square = new Square(); CorDraw drawer = new CorDraw(square); drawer.Figure.Draw(number); } else { int number = int.Parse(Console.ReadLine()); int number2 = int.Parse(Console.ReadLine()); Rectangle rectangle = new Rectangle(); CorDraw drawer = new CorDraw(rectangle); drawer.Figure.Draw(number, number2); } }