#include <iostream>
#include <cmath>
using namespace std;
class Triangle
{
public:
Triangle(double x=1,double y=1,double z=1):a(x),b(y),c(z){};
double perimeter();
double area();
void showMessage();
private:
double a,b,c;
};
void Triangle::showMessage()
{
cout<<"三角形的三边长为:"<<a<<' '<<b<<' '<<c<<endl;
cout<<"该三角形的周长为"<<perimeter()<<"面积为:"<<area()<<endl<<endl;
}
double Triangle::area()
{
double n,s;
n=(a+b+c)/2;
s=sqrt(n*(n-a)*(n-b)*(n-c));
return s;
}
double Triangle::perimeter()
{
double C;
C=a+b+c;
return C;
}
int main()
{
Triangle Tri(7,8,9);
Tri.showMessage();
return 0;
}