import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a = 0 ; int b = 0 ; int c = 0 ;
if(sc.hasNext()) {
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
}
if ( a != 0) {
double d = (b*b - 4*a*c);
if ( d >= 0 ) {
double x = ( -b - Math.sqrt(d) ) / 2*a ;
double y = ( -b + Math.sqrt(d) ) / 2*a ;
if( d > 0 ) {
System.out.println("Real and Distinct");
System.out.print(x + " " + y);
}
else if( d == 0 ) {
System.out.println("Real and Equal");
System.out.print((int) x + " " + (int) y);
}
}
else System.out.println("Imaginary");
}
else System.out.println();
}
}
My Program is successful for 2 Test Cases. It fails Test Case 0.
Can i know what exactly is Test Case 0 checking, or is there some error in my code?