📄 funtc306b.dat
字号:
#include <graphics.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>
char *lname[]={"SOLID_LINE","DOTTED_LINE","CENTER_LINE","DASHED_LINE","USERBIT_LINE"};
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int style, midx, midy, userpat;
char stylestr[40];
initgraph(&gdriver, &gmode, );
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
userpat = 1;
for (style=SOLID_LINE; style<=USERBIT_LINE; style++)
{
setlinestyle(style, userpat, 1);
strcpy(stylestr, lname[style]);
line(0, 0, midx-10, midy);
rectangle(0, 0, getmaxx(), getmaxy());
outtextxy(midx, midy, stylestr);
getch();
cleardevice();
}
closegraph();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -