static void Main(string[] args) { Console.InputEncoding = Encoding.Unicode; Console.OutputEncoding = Encoding.Unicode; int x = 0, y = 0, r = -1, R = 0; while (r < 0) { try { Console.WriteLine("Введите Х"); x = int.Parse(Console.ReadLine()); Console.WriteLine("Введите Y"); y = int.Parse(Console.ReadLine()); Console.WriteLine("Введите внутренний радиус"); r = int.Parse(Console.ReadLine()); if (r < 0) { Console.WriteLine("Введите положительное число!"); r = int.Parse(Console.ReadLine()); } Console.WriteLine("Введите внешний радиус"); R = int.Parse(Console.ReadLine()); if (R < 0) { Console.WriteLine("Введите положительное число!"); R = int.Parse(Console.ReadLine()); } } catch { Console.WriteLine("Введите корректные данные!"); } } Ring ob = new Ring(x, y, r, R); Console.WriteLine("Площадь кольца = {0}\nСуммарная длина окружностей = {1}", ob.GetAreaRing(), ob.GetSumLength(r, R)); Console.ReadKey(); }