Untitled

mail@pastecode.io avatar
unknown
csharp
2 months ago
1.1 kB
1
Indexable
Never
using System;

namespace Program
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("apo: ");
            double apo = double.Parse(Console.ReadLine());

            Console.Write("boo: ");
            double boo = double.Parse(Console.ReadLine());

            Console.Write("css: ");
            double css = double.Parse(Console.ReadLine());

            Console.Write("ddd: ");
            double ddd = double.Parse(Console.ReadLine());

            Console.Write("ew: ");
            double ew = double.Parse(Console.ReadLine());

            double f = 1 / (Math.Sqrt((apo - Math.Sqrt(ew))));
            double g = Math.Sqrt(((boo + Math.Sqrt(boo + Math.Sqrt((ddd - boo)))) / css));
        
            if (double.IsNaN(f) || double.IsNaN(g)) {
                Console.WriteLine("ERROR");
            } else
            {
                Console.WriteLine($"f = {Math.Round(f, 3)}");
                Console.WriteLine($"g = {Math.Round(g, 3)}");
            }
        }
    }
}
Leave a Comment