JAVA 题目求答案,只要答案

2024-11-21 23:13:17
推荐回答(1个)
回答1:

import java.util.Scanner;

public class D {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double a = sc.nextDouble();
double b = sc.nextDouble();
double c = sc.nextDouble();
if (a + b >行核 c && a + c > b && c + b >档庆掘 a) {
double p = (a + b + c) / 2;
double result = Math.sqrt(p * (p - a) * (p - b) * (p - c));
System.out.println(result);
} else {
System.out.println("您输入的三条边的长度不能差哪构成三角形!");
}
}
}