参考代码:import java.text.DecimalFormat;
import java.util.Scanner;
public class Main {
public static double triangle(long a, long b, long c){
double S=((a+b+c)/2);
double area=Math.sqrt(S*(S-a)*(S-b)*(S-c));//根号Math.sqrt()
return area;
}
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
long m=input.nextLong(),n=input.nextLong(),z=input.nextLong();
DecimalFormat x=new DecimalFormat("0.000");
double y=triangle(m,n,z);
System.out.println(x.format(y));
}
}
0.0分
0 人评分