一个C++菜鸟 2022-02-06 21:42 采纳率: 50%
浏览 32
已结题

c++镇国之争游戏(带存档,无bug)——有问题!

OMG!
有人能告诉我为什么出问题吗?
代码如下:

#ifndef YRGAME
#define YRGAME
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<time.h>
#include<cctype>
#include <stdlib.h>
#include <cstdio>
#include <conio.h>
#include <cstdlib>
#include <fstream>
#include <windows.h>
#include <algorithm>
using namespace std;
 
void YROUT(string xinxi)
{
    for (int item=0;item<xinxi.size();item++)
    {
        cout<<xinxi[item];
        Sleep(70);
    }
}
 
void colorF0()
{
    system("color F0");
}
 
void color(int c)//颜色
{
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c);
    return;
}
 
 
void hidecursor()//隐藏光标
{
    CONSOLE_CURSOR_INFO cursor;
    cursor.bVisible = FALSE;
    cursor.dwSize = sizeof(cursor);
    HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleCursorInfo(handle, &cursor);
    return;
}
 
void title(string net)//
{
    string t = "title ";
    t += net;
    system(&t[0]);
    return;
}
 
void YRGAMEBANBEN()//查看当前YRGAME库版本信息
{
    cout<<endl<<"库名:YRGAME"<<endl;
    cout<<"类型:拓展库"<<endl;
    cout<<"版本号:YR5774 TRTR032098@qq.com"<<endl;
    return;
}
 
 
void cls(){system("cls");}
void retr(){//退出程序 
    HWND hWnd=GetForegroundWindow();
    ShowWindow(hWnd,SW_HIDE);
    exit(0);
}
 
void click_left(){//鼠标左键点击
    mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);  
    Sleep(5);//要留给某些应用的反应时间   
    mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0); 
}
void click_right(){//鼠标右键点击
    mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);  
    Sleep(5);   
    mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);  
}
 
 
#endif

编译3秒后,弹出一个"源代码未编译"的窗口!

图片如下:

img

哦,对了,代码的源网站如下:
https://blog.csdn.net/m0_64036070/article/details/122798822?utm_source=app&app_version=5.0.0
还有,我用的软件与作者用的一模一样!

img

请大家解答一下,谢谢!

  • 写回答

1条回答 默认 最新

  • 关注

    你好 你点确定就行了 博文里面写了

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

报告相同问题?

问题事件

  • 系统已结题 5月29日
  • 已采纳回答 5月21日
  • 创建了问题 2月6日

悬赏问题

  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路
  • ¥15 phython读取excel表格报错 ^7个 SyntaxError: invalid syntax 语句报错