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
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 03:22:20
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
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
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
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粗心导致,应该不需要所谓的详细解释吧.