曲奇朴朴 2021-07-12 17:04 采纳率: 33.3%
浏览 142
已结题

easyx用c/c++绘制

绘制竖排古诗,并进行变换字体,颜色等操作,输出的文字是竖排的

  • 写回答

1条回答 默认 最新

  • iook_milu 2022-07-05 16:57
    关注

    自己写的,也是小白

    #include<graphics.h>
    #include<conio.h>
    #include<time.h>
    int main() {
    char str1[] = { "离 野 远 又" };
    char str2[] = { "离 火 芳 送" };
    char str3[] = { "原 烧 侵 王" };
    char str4[] = { "上 不 古 孙" };
    char str5[] = { "草 尽 道 去" };
    char str6[] = { " , , , ," };
    char str7[] = { "一 春 晴 萋" };
    char str8[] = { "岁 风 翠 萋" };
    char str9[] = { "一 吹 接 满" };
    char str10[] = { "枯 又 荒 别" };
    char str11[] = { "荣 生 城 情" };
    char str12[] = {"赋"};
    char str13[] = {"得"};
    char str14[] = {"古"};
    char str15[] = {"原"};
    char str16[] = {"草"};
    char str17[] = {"送"};
    char str18[] = {"别"};
    initgraph(340, 600);
    setbkcolor(WHITE);
    cleardevice();
    srand((unsigned int)time(NULL));
    int x = -1;
    while (x) {
    settextcolor(RGB(rand() % 256, rand() % 256, rand() % 256));
    settextstyle(40, 0, "楷体");
    outtextxy(100, 80, str1);
    outtextxy(100, 120, str2);
    outtextxy(100, 160, str3);
    outtextxy(100, 200, str4);
    outtextxy(100, 240, str5);
    outtextxy(100, 280, str6);
    outtextxy(100, 320, str7);
    outtextxy(100, 360, str8);
    outtextxy(100, 400, str9);
    outtextxy(100, 440, str10);
    outtextxy(100, 480, str11);
    outtextxy(20, 110, str12);
    outtextxy(20, 160, str13);
    outtextxy(20, 210, str14);
    outtextxy(20, 260, str15);
    outtextxy(20, 310, str16);
    outtextxy(20, 360, str17);
    outtextxy(20, 410, str18);
    Sleep(1000);
    }
    _getch();
    closegraph();
    return 0;
    }

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 7月16日
  • 已采纳回答 7月8日
  • 创建了问题 7月12日

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集