package Hello;
import java.util.Scanner;
public class HelloJava{
public static void main(String[] args) {
double a,b,c;
while(true) {
System.out.println("Please enter a:");
Scanner sc = new Scanner(System.in);
a=sc.nextDouble();
System.out.println("Please enter b:");
Scanner sc1 = new Scanner(System.in);
b=sc1.nextDouble();
System.out.println("Please enter c:");
Scanner sc2 = new Scanner(System.in);
c=sc2.nextDouble();
if(b*b-4*a*c<0) {
System.out.println("The equation has no solution");
}
else {
double X1=(-b+Math.sqrt(b*b-4*a*c))*1/(2*a);
double X2=(-b-Math.sqrt(b*b-4*a*c))*1/(2*a);
System.out.println("The root of the equation is:"+X1);
System.out.println("The root of the equation is:"+X2);
break;
}
}
}
}