c语言怎么用EGE 图形库

Python025

c语言怎么用EGE 图形库,第1张

1、EGE(Easy Graphics Engine),是windows下的简易绘图库,是一个类似BGI(graphics.h)的面向C/C++语言新手的图形库,它的目标也是为了替代TC的BGI库而存在。

2、它的使用方法与TC中的graphics.h相当接近,对新手来说,简单,友好,容易上手,免费开源,而且因为接口意义直观,即使是之前完全没有接触过图形编程的,也能迅速学会基本的绘图。 目前,EGE图形库已经完美支持VC6, VC2008, VC2010, C-Free, DevCpp, Code::Blocks, wxDev, Eclipse for C/C++等IDE,即支持使用MinGW为编译环境的IDE。如果你需要在VC下使用graphics.h,那么ege将会是很好的替代品。

#include #include //srand函数头文件#include //time函数头文件#include //rand函数头文件#include //Sleep函数头文件void delay(int sec){time_t start_time, cur_time// 变量声明time(&start_time)do{time(&cur_time)} while((cur_time

#include#include#include#includeusingnamespacestdvoidxuanzepaixu()//选择排序函数{printf("待添加,请按任意键继续")getchar()}voiderfenpaixu()//二分查找函数{printf("待添加,请按任意键继续")getchar()}voidmenu()//主菜单{system("cls")//清屏printf("\n\t\t\t菜单\n")printf("\t\t\t#***********************#\n")printf("\t\t\t#1选择排序#\n")printf("\t\t\t#2二分查找#\n")printf("\t\t\t#3返回#\n")printf("\t\t\t#4---关闭#\n")printf("\t\t\t#***********************#\n")printf("\t\t\t请选择(1-4)=:")}voidmain(){charselectwhile(1){menu()system("COLOR9f")scanf("%c",&select)if(select=='3')break//返回上级菜单else{getchar()//读入回车符if(!isdigit(select))//如果不是数字字符{printf("\n\7Yourselectmaybewrong,mustenterthedigit!\n")_getch()}else{switch(select){case'1':xuanzepaixu()breakcase'2':erfenpaixu()breakcase'4':exit(0)//直接退出default:{printf("\n\7\7Yourselecteddigitmaybewrong,selectagain!\n")_getch()break}}}}}}