梯形的面积公式:(上底+下底)*高/2
顺手点个赞吧
#include<bits/stdc++.h>
using namespace std;
int main(){
double a,b,c,a1,b1,c1;
cin>>a>>b>>c;
a1=a;b1=b;c1=c;
if(a>b)swap(a,b);
if(b>c)swap(b,c);
if(a>b)swap(a,b);
if(a+b<=c)printf("Area = %.1lf",(a1+b1)*c1/2);//注意,这里要用原来的底和高
else printf("Perimetro = %.1lf",a+b+c);
}