public class PhuongTrinhBacHai
public static void Main()
Double a,b,c,root1,root2,delta;
Console.WriteLine("Nhập vào hệ số a, b, c của phương trình ax2 + bx +c:");
Console.Write("Nhap a:");
a = Double.Parse(Console.ReadLine());
Console.Write("Nhap b:");
b = Double.Parse(Console.ReadLine());
Console.Write("Nhap b:");
c = Double.Parse(Console.ReadLine());
root1 = (-b + Math.Sqrt(delta))/(2*a);
root2 = (-b - Math.Sqrt(delta))/(2*a);
Console.WriteLine("Phương trình có hai nghiệm phân biệt:");
Console.WriteLine("x1 = "+root1 + ", x2 = " + root2);
Console.WriteLine("Phương trình có nghiệm kép:");
Console.WriteLine("x1 = x2 = " + root2);
Console.WriteLine("Phương trình vô nghiệm");