1. 编程学习网 > 编程教程 > C语言教程 > C语言经典案例:利用ellipse and rectangle 画图(在TC中实现)

C语言经典案例:利用ellipse and rectangle 画图(在TC中实现)

需求描写:应用ellipse and rectangle 绘图(在TC中实现)。

C语言案例剖析:无。

程序源代码:

// Copyright © 2015年 菜鸟教程. All rights reserved.

#include "stdio.h"

#include "graphics.h"

#include "conio.h"

main()

{

int driver=VGA,mode=VGAHI;

int i,num=15,top=50;

int left=20,right=50;

initgraph(&driver,&mode,"");

for(i=0;i<num;i++)

{

ellipse(250,250,0,360,right,left);

ellipse(250,250,0,360,20,top);

rectangle(20-2*i,20-2*i,10*(i+2),10*(i+2));

right+=5;

left+=5;

top+=10;

}

getch();

}

本文由IT教学网整理发布,转载请注明出处:http://www.itjx.com/jiaocheng/cyuyan/1003.html

联系我们

在线咨询:点击这里给我发消息

咨询电话:400-998-2681

工作时间:7*24小时无休