c++ 求三角形周长和面积
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/06/15 21:11:18
c++ 求三角形周长和面积
#include
#include
using namespace std;
class Point{
public:
Point(double xx=0 ,double yy=0 ){
x =xx;
y=yy;
}
Point(Point&p);
double getX(){
return x ;
}
double getY(){
return y;
}
private:
double x,y;
};
Point::Point(Point&p){
x=p.x;
y=p.y;
cout
#include
#include
using namespace std;
class Point{
public:
Point(double xx=0 ,double yy=0 ){
x =xx;
y=yy;
}
Point(Point&p);
double getX(){
return x ;
}
double getY(){
return y;
}
private:
double x,y;
};
Point::Point(Point&p){
x=p.x;
y=p.y;
cout
class Triangle{
public :
Triangle(Point a ,Point b ,Point c);
double getPermiter(){return len;} //分号应该在大括号前面
double getArea(){return area;}//分号应该在大括号前面
private:
Point aa,bb,cc;
double len,area;
}; //这里少了个分号
全是LZ粗心导致,应该不需要所谓的详细解释吧.
public :
Triangle(Point a ,Point b ,Point c);
double getPermiter(){return len;} //分号应该在大括号前面
double getArea(){return area;}//分号应该在大括号前面
private:
Point aa,bb,cc;
double len,area;
}; //这里少了个分号
全是LZ粗心导致,应该不需要所谓的详细解释吧.