kwrl.net
当前位置:首页 >> 急!!!C++问题,先定义"点"类Point,由"点"类派... >>

急!!!C++问题,先定义"点"类Point,由"点"类派...

可选中1个或多个下面的关键词,搜索相关资料。也可直接点“搜索资料”搜索整个问题。 课程设计三角形c++判断三角形类型面积

class Point { public: int x; int y; public: Point( int X = 0, int Y = 0 ) { x = X; y = Y; } }; class Circle : public Point { public: int r; public: Circle( int X = 0, int Y = 0, int R = 0 ) { x = X; y = Y; r = R; } }

#include #include using namespace std; class Point { private: float x,y; public: Point(){} Point(float a,float b):x(a),y(b){} Point(Point& a); float Distance(Point b); }; Point::Point(Point& a) { x=a.x; y=a.y; } float Point::Di...

看primer 就知道了

#include using namespace std; class Point { public: Point(int xx = 0,int yy = 0) { x = xx; y = yy; } ~Point(void) { } protected: int x,y; }; class Circle:public Point { public: Circle(int xx = 0,int yy = 0,int rr = 0) { Point(x...

#include #include const double pi=3.14; class Shape//抽象基类 { public: virtual void display()=0; }; class Point:public Shape { public: void display(){}; }; class Circle:public Point { private: double r; public: void set(double...

class Point { public: virtual int GetArea(){} public: int x; int y; } class Rectangel:public Point { public: int GetArea(){return x*y;} } class Circle:public Point { public: int GetArea(){return 3.14*x*y;} } 直接手打的,基本是...

#include#include#include //添加函数using namespace std;class Point{public:// 不能用protectedint x,y;public: Point(int a,int b):x(a),y(b){}};class Line:public Point{Point t2;public:Line(int x1,int x2,int y1,int y2):Point(x1,y1),...

friend ostream & operator

class Point { private: double x; double y; public: Point(); Point(double x1, double y1) {x=x1;y=y1} void set(double x1, double y1) {x=x1;y=y1} void Display() {cout

网站首页 | 网站地图
All rights reserved Powered by www.kwrl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com