编辑代码

#include <iostream>
#include <math.h>
using namespace std;
int main() {
    float a,b,c;
    cin>>a>>b>>c;
    if(a+b>c,a+c>b,b+c>a)
if(a+b>c){
    cout<<"为三角形"<<endl;
		float _long,p,s;
		_long = a + b + c;
		p = _long / 2;
		//三角形面积公式
		s = sqrt(p * (p - a) * (p - b) * (p - c));
		cout<<"三角形的周长为:"<<_long<<endl;
		cout<<"三角形的面积为:"<<s<<endl;
}
else 
{
    cout<<"不为三角形"<<endl;
}
return 0;
}