#include
#include
using namespace std;
bool panduan(double x,double y,double z);//函数需要声明
void mianji(double d,double e,double f);
int main()
{
double a,b,c,s;
cout<<"请输入三角形的边长"<
mianji(a,b,c);
//cout<
return 0;
}
bool panduan(double x,double y,double z)
{
// cin>>x>>y>>z>>endl;
if (x + y > z && x + z > y && y + z > x)
{
//cout<<"能够成三角形"<
}
return false; //if three sides can not form a triangle
}
void mianji(double d,double e,double f) //should return a value as the area
{
double cosde,s;
//cin>>d>>e>>f; //此时应该判断三边是否可以组成三角形
if (panduan(d,e,f))
{
cout<<"能够构成三角形"<
s=0.5*d*e*sqrt(1-cosde*cosde);
//return s; //return the area value
cout<<"三角形的面积是:"< }
else
{
cout<<"不能组成三角形"<
}
}
#include
#include
void main()
{ float a,b,c,s,A;
scanf("%f %f %f",&a,&b,&c);
s=(a+b+c)/2.0;
A=s*(s-a)*(s-b)*(s-c);
if(A<=0)
printf("不能构成三角形");
else
printf("三角形面积=%f",sqrt(A));
}