Java 代码
import java.util.Scanner;
public class Main
{
public static void main (String[] arg)
{
Scanner cin = new Scanner(System.in);
double a = cin.nextDouble();
double b = cin.nextDouble();
double c = cin.nextDouble();
if ( (a+b)> c && (b+c)>a && (c+a)>b)
System.out.println("Perimetro = " + String.format("%.1f", a+b+c));
else
System.out.println("Area = " + String.format("%.1f", (a+b)*c/2.0));
}
}