import java.util.*;
public class SolveQuad {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter value of a");
double a = sc.nextInt();
System.out.println("Enter value of b");
double b = sc.nextInt();
System.out.println("Enter value of c");
double c = sc.nextInt();
System.out.println("The entered Quadratic equation is:");
System.out.println(a+"x2"+"+"+b+"x"+"+"+c);
double d = b*b-4*a*c;
if(d>0.0){
double r1=(-b+Math.pow(d,0.5))/2.0*a;
double r2=(-b-Math.pow(d,0.5))/2.0*a;
System.out.println("The first root is: "+r1+"\n "+"The Second root is: "+r2);
} else if(d==0.0){
double r1=-b/(2*a);
System.out.println("The root of the equation is: "+r1);
} else{
System.out.println("The given equation has no real roots");
}
}
}