Beispiel #1
0
        public static void RoundExample()
        {
            Round round = new Round(1, 1, 10);

            Console.WriteLine($"Length: {round.Length(): 0.###}\n" +
                              $"Area: {round.Area(): 0.###}\n");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Round c1 = new Round();
            Round c2 = new Round();

            Console.WriteLine("Введите данные первого круга:");
            ReadRound(ref c1);
            Console.WriteLine("Введите данные второго круга:");
            ReadRound(ref c2);
            Console.WriteLine(Contact(c1, c2));
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Площадь первого круга : {0} Площадь второго круга: {1}", Math.Round(c1.Area()), Math.Round(c2.Area()));
            Console.WriteLine();
            Console.WriteLine("Периметр первого круга : {0} Периметр второго круга: {1}", Math.Round(c1.Length()), Math.Round(c2.Length()));
            Console.ReadKey();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите координаты центра круга:");
            Console.Write("x=");
            double x = Convert.ToInt32(Console.ReadLine());

            Console.Write("y=");
            double y = Convert.ToInt32(Console.ReadLine());
            Point  o = new Point(x, y);

            Console.WriteLine("Введите радиус круга:");
            Console.Write("r=");
            double r = Convert.ToInt32(Console.ReadLine());
            Round  R = new Round(o, r);

            Console.WriteLine("Площадь круга = {0}", R.Area());
            Console.WriteLine("Длина окружности круга = {0}", R.LengthR());

            Console.Write("\nНажмите любую клавишу для закрытия программы.");
            Console.ReadKey();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Round c1 = new Round();
            Round c2 = new Round();

            Console.WriteLine("Введите данные первого круга:");
            ReadRound(ref c1);
            Console.WriteLine("Введите данные второго круга:");
            ReadRound(ref c2);
            Console.WriteLine(Contact(c1, c2));
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Площадь первого круга : {0} Площадь второго круга: {1}", Math.Round(c1.Area()), Math.Round(c2.Area()));
            Console.WriteLine();
            Console.WriteLine("Периметр первого круга : {0} Периметр второго круга: {1}", Math.Round(c1.Length()), Math.Round(c2.Length()));
            Console.ReadKey();
        }