using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите первый коэффициент");
int a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите второй коэффициент");
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите третий коэффициент");
int c = Convert.ToInt32(Console.ReadLine());
double d;
d = b * b - 4 * a * c;
if (d < 0)
{
Console.WriteLine("Дискриминант отрицательный, корней нет");
}
if (d == 0)
{
double x1 = b / (2 * a);
Console.WriteLine("Дискриминант = 0, x = {0}", x1);
}
if (d > 0)
{
double x1 = (-b + Math.Sqrt(Convert.ToDouble(d)))/(2*a);
double x2 = (-b - Math.Sqrt(Convert.ToDouble(d))) / (2 * a);
Console.WriteLine("Дискриминант = {0}, x1 = {1}, x2 ={2}",d, x1,x2);
}
}
}
}