뭐가틀렸나요?..

sodon5 Reply 9 years 11 weeks ago
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner keyboard=new Scanner(System.in); double a=keyboard.nextDouble(); double b=keyboard.nextDouble(); double c=keyboard.nextDouble(); double result; if((b*b-4*a*c)<0) { System.out.println("complex"); } else { result=Math.floor((-b+Math.sqrt(b*b-4*a*c))/(2*a)*10)/10; System.out.printf("%.1f",result); } } } 어디가틀렸는지모르겠어요..
cjmp1 Reply 9 years 11 weeks ago
a<0 일때 최댓값이 변해용
sodon5 Reply 9 years 11 weeks ago
아헐...감사해요ㅠㅠ