写一个Java版的保留精度
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
double a = in.nextDouble();
double b = in.nextDouble();
double c = in.nextDouble();
java.text.DecimalFormat df = new java.text.DecimalFormat("#.0");
if(a+b > c && a+c > b && b+c>a){
System.out.println("Perimetro = " + df.format(a+b+c));
}else{
System.out.println("Area = "+ df.format((a+b)*c/2.0));
}
}
}