关于C语言的简单图形程序
发布网友
发布时间:2022-05-27 03:18
我来回答
共1个回答
热心网友
时间:2024-11-06 20:09
你可以到网上搜一下,搜一下C图形程序的代码,
算了,我给你一个程序,是房子的,你可以自己改改其中参数,或者上点颜色什么的。
你谢smilegn去吧
#include<graphics.h>
#include<stdio.h>
main()
{
int gn1[]={420,150,540,150,580,180,380,180,420,150};
int driver=DETECT, mode;
initgraph(&driver,&mode," ");
setbkcolor(BLACK);setcolor(WHITE);
drawpoly(5,gn1);
rectangle(420,180,540,290);
rectangle(435,210,460,230);
line(435,220,460,220);
line(447.5,210,447.5,230);
rectangle(500,225,525,290);
rectangle(435,125,445,150);
circle(442,110,6);
circle(453,102,4);
circle(464,94,2);
line(480,310,505,310);
line(465,335,485,335);
line(450,355,466,355);
getch();
closegraph();
}
参考资料:百度知道中smilegn的帖子中的程序