正在加载图片...
Base(int px, int py): posz (px), posy ( py)t virtual void draw(=0 protected: Int posx,posy;//图形对象的位置 class Point: public Base f public Point(int px, int py): Base(px, py)() void drawoi SetPixel(pos x, posy):) class Colorpoint: public point ColorPoint(int px, int py): Point (px, py)color=0: I ColorPoint (int px, int py, int c): Point(px, py), color(c)i] void draw SetColor(color) Point:: draw protected int color /***********冰*水********冰*******冰**********冰水**水*冰****水****/Base(int px,int py);posz(px),posy(py){ }; virtual void draw()=0; protected: int posx,posy; //图形对象的位置 }; class Point:public Base{ public: Point(int px,int py):Base(px,py){ } void draw(){ SetPixel(posx,posy); } }; class Colorpoint:public Point{ public; ColorPoint(int px,int py):Point(px,py){color=0;} ColorPoint(int px,int py,int c):Point(px,py),color(c){ } void draw() { SetColor(color); Point::draw(); } protected: int color; }; /**************************************************************************/
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有