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/04/28 00:50:01
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
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粗心导致,应该不需要所谓的详细解释吧.