Untitled

mail@pastecode.io avatar
unknown
csharp
2 months ago
1.1 kB
3
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 / 100) - (1 / apo) - (1 / (Math.Pow(boo, 2)));
            double g = (1 / (Math.Pow(css, 2))) + (Math.Sqrt(ew)) / (Math.Pow(ddd, 3));
        
            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