一般人都知道的问题c++

computech_newRen 2006-12-14 04:42:12
帮忙看看下面的程序哪儿有错
#include "stdafx.h"

#include <graphics.h>
#include <conio.h>

class location
{
protected:
int x,y;
public:
location(int initx,int inity);
};

class point:public location
{
public:
point(int initx,int inity);
void show();
void hide();
void moveto(int newx,int newy);
};

class circles:point
{
private:
int radius;
public:
circles(int initx,int inity,int initradius);
void show();
void hide();
void expand(int expandby);
void moveto(int nx,int ny);
void contract(int contractby);
};

location::location(int initx,int inity)
{
x=initx;
y=inity;
}

point::point(int initx,int inity):location(initx,inity)

void point::show()
{
putpixel(x,y,getcolor());
}
void point::hide()
{
putpixel(x,y,getbkcolor());
}
void point::moveto(int newx,int newy)
{
hide();
x=newx;
y=newy;
show();
}
circles::circles(int initx,int inity,int initradius):point(int initx,int inity)
{
radius=initradius;
}
void circles::show()
{
circle(x,y,radius);
}
void circles::hide()
{
unsighed int tempcolor;
temcolor=getcolor();
setcolor(getbkcolor());
circle(x,y,radius);
setcolor(tempcolor);
}
void circles::expand(int expandby)
{
hide();
radius+=expandby;
if(radius<0)
eadius=0;
show;
}
void ciecles::moveto(int newx,int newy)
{
hide();
x=newx;
y=newy;
show();
}
main()
{
int gdriver=DETECT,gmode;
inigraph(&gdriver,&gmode,"c:..\\bgi");
circles myciecle(100,200,50);
setcolor(10);
mycircle.show();
getch();
mycircle.moveto(200,250);
getch();
mycircle.expand(50);
getch();
mycircle.contract(75);
getch();
closegraph();
return 0;
}


...全文
238 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
拿节 2006-12-15
  • 打赏
  • 举报
回复
哈哈!我也不是一般人!
不想低调 2006-12-14
  • 打赏
  • 举报
回复
mark
wonxlei 2006-12-14
  • 打赏
  • 举报
回复
我终于了解:
我不是一般人
navyblue1982 2006-12-14
  • 打赏
  • 举报
回复
我也不是一般人
lw1a2 2006-12-14
  • 打赏
  • 举报
回复
意味着不是一般人
OOPhaisky 2006-12-14
  • 打赏
  • 举报
回复
一般人都知道的问题c++
------------------------------------------------------------------------------------
我不知道,那意味着什么?
computech_newRen 2006-12-14
  • 打赏
  • 举报
回复
图形的基本单元是屏幕上的单个的点,可定义一个专门用来描述屏幕位置的类location,由它派生出具有显示、隐去、放大、缩小和移动功能的point类,再从point类派生出圆类circles,在ciecles类中将location类的数据成员作为圆心.

64,676

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧