⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 3_5.c

📁 浙大《C语言设计基础课程设计》中的例程 有些比较好的代码!
💻 C
字号:
/*------例程3-5------*/
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
main()
{
  int graphdriver;
  int graphmode;
  clrscr();
  detectgraph(&graphdriver,&graphmode);
  switch(graphdriver)		{
     case CGA:printf("\nGraphics adapter is CGA,now set as CGAC1 mode");
	      graphmode=1; 		/*	设置成低分辨模式	*/
	      break;
     case EGA:printf("\nGraphics adapter is EGA,now set as EGALO mode");
	      graphmode=0;		/*	设置成低分辨模式	*/
	      break;
     case VGA:printf("\nGraphics adapter is VGA,now set as VGAMED mode");
	      graphmode=1;		/*	设置成中分辨模式	*/
	      break;
     case -2:
	      printf("\nGraphics adapter not installed");
	      exit(1);
     default:
	     printf("\nGraphics adapter is not CGA, EGA or VGA");
  }
  initgraph(&graphdriver,&graphmode,"");
  /*接下来就可以作图了,在此忽略*/
  getch();
  closegraph();
}
/*------例程3-5结束------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -