어디가 잘못됐는지 모르겠어요

sdseon21 Reply 4 years 31 weeks ago
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System. in); double x1 = input.nextDouble(); double y1 = input.nextDouble(); double x2 = input.nextDouble(); double y2 = input.nextDouble(); double x3 = input.nextDouble(); double y3 = input.nextDouble(); double s1 = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); double s2 = Math.sqrt((x3-x2)*(x3-x2) + (y3-y2)*(y3-y2)); double s3 = Math.sqrt((x1-x3)*(x1-x3) + (y1-y3)*(y1-y3)); double s = (s1 + s2 + s3)/2; double area = Math.sqrt(s*(s-s1)*(s-s2)*(s-s3)); System.out.printf("%.1f\n",area); } } 예시 문제에 대한 결과값은 나오는데 wrong answer가 뜹니다..!
withcs2 Reply 4 years 31 weeks ago
%.1f는 반올림한 값입니다. 구해야하는 건 버림한 값이에요. 거의 다 왔어요 화이팅!