Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите свое имя");
            string name = Console.ReadLine();

            Console.WriteLine("Введите свою фамилию");
            string surname = Console.ReadLine();

            Console.WriteLine("Сколько вам лет?");
            byte age = Convert.ToByte(Console.ReadLine());

            Console.WriteLine("Ваш рост?");
            byte height = Convert.ToByte(Console.ReadLine());

            Console.WriteLine("Ваш вес?");
            short weight = Convert.ToInt16(Console.ReadLine());

            Console.WriteLine("Ваша aнкета, способ 1");
            Console.WriteLine("Имя: " + name + " Фамилия: " + surname + " Возраст: " + age + " Рост: " + height + " Вес: " + weight);

            Console.WriteLine("Ваша анкета, способ 2");
            Console.WriteLine(String.Format("Имя: {0} Фамилия: {1} Возраст: {2} Рост: {3} Вес: {4}", name, surname, age, height, weight));

            Console.WriteLine("Ваша анкета, способ 3");
            Console.WriteLine($"Имя: {name} Фамилия: {surname} Возраст: {age} Рост: {height} Вес: {weight}");

            Shortener.WaitKeyPressed();
        }
Example #2
0
        static void Main(string[] args)
        {
            Shortener.Print("Введите x1");
            double x1 = Convert.ToDouble(Console.ReadLine());

            Shortener.Print("Введите y1");
            double y1 = Convert.ToDouble(Console.ReadLine());

            Shortener.Print("Введите x2");
            double x2 = Convert.ToDouble(Console.ReadLine());

            Shortener.Print("Введите y2");
            double y2 = Convert.ToDouble(Console.ReadLine());

            // задание а)
            double resultA = Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));

            // задание б)
            double resultB = Distance(x1, y1, x2, y2);

            Console.WriteLine(String.Format("Расстояние, задание а) {0:F2}", resultA));
            Console.WriteLine(String.Format("Расстояние, задание б) {0:F2}", resultB));

            Shortener.WaitKeyPressed();
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите вес(в кг):");
            double weight = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("Введите рост (в метрах):");
            double height = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine($"Индекс массы тела: {IMT(weight, height)}");

            Shortener.WaitKeyPressed();
        }