hahahaYI3 2024-02-27 21:49 采纳率: 100%
浏览 5
已结题

关于#c++#的问题:easyx程序换了一台电脑就打不开

easyx的程序打不开怎么办啊

img


```c++
#include <graphics.h>
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
wstring Student[2] = { L"张三",L"李四" };
int main() {
    srand(time(0));
    initgraph(640, 480);
    setbkcolor(WHITE);
    setbkmode(TRANSPARENT);
    cleardevice();
    settextcolor(RED);
    setlinecolor(BLUE);
    setfillcolor(BLUE);
    while (true) {
        bool flag = false;
        ExMessage msg = { 0 };
        if (peekmessage(&msg, EX_MOUSE)) {
            settextcolor(RED);
            outtextxy(230, 150, _T("点击按钮抽取幸运儿!"));
            fillrectangle(280, 180, 320, 220);
            settextcolor(YELLOW);
            if (!flag)outtextxy(285, 190, _T("点我"));
            if (flag)outtextxy(280, 190, _T("再来一次"));
            if (msg.message == WM_LBUTTONDOWN && (msg.x <= 320 && msg.x >= 280) && (msg.y <= 220 && msg.y >= 180)) {
                flag = true;
                cleardevice();
                int temp = rand() % 2 + 0;
                int S = 10;
                for (int i = temp; i <= temp + 50 - 1;i++) {
                    settextcolor(BLUE);
                    int temp1 = rand() % 2 + 0;
                    outtextxy(275, 100, Student[temp1].c_str());
                    Sleep(S);
                    S += 10;
                    cleardevice();
                    settextcolor(RED);
                    outtextxy(230, 150, _T("点击按钮抽取幸运儿!"));
                    settextcolor(YELLOW);
                    fillrectangle(280, 180, 320, 220);
                    if (!flag)outtextxy(285, 190, _T("点我"));
                    if (flag)outtextxy(280, 190, _T("再来一次"));
                }
                settextcolor(GREEN);
                outtextxy(275, 100, Student[temp].c_str());
            }
        }
    }
}


  • 写回答

5条回答 默认 最新

  • flower980323 2024-02-28 14:03
    关注

    在可以运行的电脑上用everything软件查找到缺失的dll跟exe一起打包到新电脑就可以了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

问题事件

  • 系统已结题 5月5日
  • 已采纳回答 4月27日
  • 创建了问题 2月27日