#include<iostream>
#include<math.h>
using namespace std;
int main()
{
double a,b,c;
double v,p;
cout<<"请输入三角形三条边:"<<endl;
cin>>a>>b>>c;
if(a+b>c&&a+c>b&&b+c>a)
{
扫描二维码关注公众号,回复:
2251336 查看本文章
p=(a+b+c)/2;
v=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<"该三角形面积是"<<v<<endl;
if(a==b&&a==c)
cout<<"该三角形是等边三角形!"<<endl;
else
if(a==b&&a!=c||a==c&&a!=b||b==c&&b!=a)
cout<<"该三角形是等腰三角形!"<<endl;
if((a*a+b*b==c*c)||(a*a+c*c==b*b)||(c*c+b*b==a*a))
cout<<"该三角形是直角三角形!"<<endl;
}
else
cout<<"这三条边组不成三角形!"<<endl;
return 0;
}