funtc261b.dat

来自「C++指令字典 一个方便的软件 用于C++指令的查询」· DAT 代码 · 共 36 行

DAT
36
字号
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
    int gdriver = DETECT, gmode, errorcode;
    int x, y;
    initgraph(&gdriver, &gmode, );
    errorcode = graphresult();
    if (errorcode != grOk)
    {
        printf("Graphics error: %s", grapherrormsg(errorcode));
        printf("Press any key to halt:");
        getch();
        exit(1);
    }
    x = getmaxx() / 2;
    y = getmaxy() / 2;
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    outtextxy(x, y, "Press any key to exit graphics:");
    getch();
    restorecrtmode();
    printf("We're now in text mode.");
    printf("Press any key to return to graphics mode:");
    getch();
    setgraphmode(getgraphmode());
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    outtextxy(x, y, "We're back in graphics mode.");
    outtextxy(x, y+textheight("W"), "Press any key to halt:");
    getch();
    closegraph();
    return 0;
}

⌨️ 快捷键说明

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