Demo entry 6645736

123

   

Submitted by 123 on Oct 11, 2017 at 15:39
Language: C#. Code size: 2.1 kB.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LabN1
{
    class Lab1_17
    {
        static void Main(string[] args)
        {
            double u, d, c, odzTg = 1.0;
            while (true)
            {

                try
                {
                    Console.Write("Enter the d: ");
                        d = double.Parse(Console.ReadLine());
                    Console.Write("Enter the c: ");
                        c = double.Parse(Console.ReadLine());
                   // проверка ОДЗ Тангенса
                    odzTg = Math.Round((((Math.Pow(c, 4) + Math.Pow(d, 4) - c * c * d * d) * (180.0 / Math.PI)) / 90.0), 1);
                    odzTg = odzTg % 2.0;
                    while (true)
                    {

                        //Область опредеоение функции
                        if (((c * c + d * d - c * d + 3.14) < 0) | (odzTg == 1.0))
                        {
                            Console.WriteLine("Error! Domain of function is\'n true! Try again...");
                            break;
                        }
                        else
                        {
                            //Вычисляем функцию...
                            u = ((Math.Sin(Math.Abs(Math.Pow(c,2) + Math.Pow(d,2) - c * d)) * Math.Sin(Math.Abs(Math.Pow(c,2) + Math.Pow(d,2) - c * d)));
                            u = u / (Math.Sqrt(Math.Pow(c,2) + Math.Pow(d,2) - c * d + 3.14) + 2.0)) + Math.Log10(Math.Pow(c, 4.0) + Math.Pow(d, 4.0) - Math.Pow(c,2) * Math.Pow(d,2));
                            Console.WriteLine("u = {0}", u);
                            break;
                        }
                    }
                    break;
                }
                catch
                {
                    Console.WriteLine("Invalid format! Try again...");
                }
            }
            //-------------------
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).