欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

C语言编程之用ellipse画椭圆

程序员文章站 2022-03-31 14:52:08
...

问题描述:请使用ellipse函数画椭圆。

程序源码:

#include "stdio.h"
#include "graphics.h"
#include "conio.h"
void main()
{
int x=360,y=160,driver=VGA,mode=VGAHI;
int num=20,i;
int top,bottom;
initgraph(&driver,&mode,"");
top=y-30;
bottom=y-30;
for(i=0;i<num;i++)
{
ellipse(250,250,0,360,top,bottom);
top-=5;
bottom+=5;
}
getch();
}