RE가계속뜨네요

WooJin Reply 9 years 9 weeks ago
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); double a=0,b=0,c=0; a = input.nextInt(); b = input.nextInt(); c = input.nextInt(); double D =Math.pow(b,2)-4*a*c; double modan1 = 0; double modan2 = 0; double an1 = 0; double an2 = 0; if(D<0) { System.out.print("complex"); } else { an1 = (-b+Math.pow(Math.pow(b,2)-4*a*c,0.5))/(2*a); an2 = (-b-Math.pow(Math.pow(b,2)-4*a*c,0.5))/(2*a); modan1 = Math.floor(10*an1)/10; modan2 = Math.floor(10*an2)/10; } if(a>0) { System.out.print(modan1); } else { System.out.print(modan2); } } } a<0일때 고려했는데도 안되네요. 뭐가 문제인지 알려주시면 감사하겠습니다.!
withcs2 Reply 9 years 9 weeks ago
실수를 받는 걸 실수하셨군요!
WooJin Reply 9 years 9 weeks ago
아 감사합니다.!