C 语言练习范例 63
题目
画椭圆ellipse(在TC中实现)
程序分析
无
程序代码
/** * file: main.c * author: 简单教程(www.twle.cn) * * Copyright © 2015-2065 www.twle.cn. All rights reserved. */ #include "stdio.h" #include "graphics.h" #include "conio.h" int 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(); }