画图,学用rectangle画方形。参考.
<P>程序分析:利用for循环控制100-999个数,每个数分解出个位,十位,百位。</P>
<P>#include "graphics.h"
main()
{int x0,y0,y1,x1,driver,mode,i;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
x0=263;y0=263;y1=275;x1=275;
for(i=0;i<=18;i++)
{
setcolor(1);
rectangle(x0,y0,x1,y1);
x0=x0-5;
y0=y0-5;
x1=x1+5;
y1=y1+5;
}
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(150,40,"How beautiful it is!");
line(130,60,480,60);
setcolor(2);
circle(269,269,137);
getch() ;</P>
<P>}</P>
<P>欢迎大家多多发帖呀!</P>
[此贴子已经被作者于2004-6-6 19:02:29编辑过] <P>有关图形的,在Win-tc运行总是出现如下的错误:</P><P>Graphics not initialized (use 'initgraph') </P><P>请问该如何解决</P> <P>可以呀!</P><P>我也是用Win-tc下运行呀</P><P>你是不是拷错了,可以运行的。</P> <P>编译是成功的,问题是图象出不来,总是提示</P><P>Graphics not initialized (use 'initgraph') </P> <P>我看看!!</P>
页:
[1]