首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
景昔
加入的小组:
景昔 的回复 更多..
  • 回复了 qq923012373 创建的主题 › C语言小组大神帮忙看看
    2016-08-24 17:35
    #include<iostream> #include<cmath> using namespace std; class Point{ public: Point(int xx=0,int yy=0) { x=xx; y=yy; } Point(Point &p); int getX(){return x;} int getY(){return y;} private: int x,y; }; Point::Point(Point &p) { x=p.x; y=p.y; cout<<"Calling the copy constructor of Point"<<endl; } class Line{ public: Line(Point xp1,Point xp2); Line(Line &a); double getLen(){return len;} private: Point p1,p2; double len; ...
  • 回复了 fhh517 创建的主题 › C++虚函数和纯虚函数
    2016-08-24 17:17
    #include <iostream.h> const double PI = 3.14; class Shape { public: virtual double area()=0; virtual double surface_area()=0; virtual double volume()=0; }; class Circle:virtual public Shape { protected: double r; public: Circle(double x){ r=x;} double area(){ return PI*r*r; } double surface_area(){return 0;} double volume(){return 0;} }; class Ball:virtual public Circle { public: Ball(double x):Circle(x...