어디가틀렸나요??

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.print("complex"); } else { result=Math.floor((-b+Math.sqrt(b*b-4*a*c))/(2*a)*10)/10; System.out.printf("%.1f",result); } } }
withcs1 Reply 9 years 11 weeks ago
discuss에 문제 번호좀..... a가 항상 양수 일까요?
sodon5 Reply 9 years 11 weeks ago
아...ch3 A - 대수: 2차방정식 풀이입니다.