W
W
wefhuieu2020-04-22 20:02:59
C++ / C#
wefhuieu, 2020-04-22 20:02:59

Write a C# program to solve an equation like, need help!?

Hello guys, help me write a C# program. Here is the task 527e46141058eb7d96c08aa205c13f7d.png
I understand that there are 3 lines of code, but I don’t know C #, please help ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Pokrovsky, 2020-04-22
@wefhuieu

(Math.Pow(a, 5) - Math.Pow(a, 3) * Math.Sqrt(b)) / (2 * c)

W
wefhuieu, 2020-04-22
@wefhuieu

Here is the solution if anyone needs it

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication39
{
    class Program
    {
        static void Main(string[] args)
        {
            double a, b, c;
            Console.WriteLine("Введите a: ");
            a = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Введите b: ");
            b = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Введите c: ");
            c = Convert.ToDouble(Console.ReadLine());
 
            new Reshenie(a,b,c).raschet();
            Console.ReadKey();
        }
    }
    class Reshenie
    {
        private double a;
        private double b;
        private double c;
        private double D;
        private double x1;
        private double x2;
        public Reshenie(double a, double b, double c)
        {
            this.a = a;
            this.b = b;
            this.c = c;
        }
        public void raschet()
        {
            D = (Math.Pow(a, 5) - Math.Pow(a, 3) * Math.Sqrt(b)) / (2 * c);
            Console.WriteLine("Ответ: {0}", D);
            Console.ReadKey();
        }
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question