TOPS 小游戏

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void M()
{
    srand(time(0));
    for(int i=0;;i++)
    {
        int x=rand()%1920;
        int y=rand()%1080;
        SetCursorPos(x,y);
        Sleep(10);
        int color=rand()%16;
        HANDLE hConsole=GetStdHandle(STD_OUTPUT_HANDLE);
        SetConsoleTextAttribute(hConsole,color);
        system("cls");
        cout<<"你的电脑中病毒了"<<endl;
        Sleep(10);
    }
    int*ptr=(int*)0x00000000;
    *ptr=10;
}
int main()
{
    cout<<"欢迎来到恶魔死亡游戏"<<endl;
    for(int i=1;i<=3;i++)
    {
        cout<<"@"<<endl;
        Sleep(1000);
    }
    system("cls");
    cout<<"是否开始"<<endl;
    cout<<"1.开始,2.离开,3.都不选"<<endl;
    int a;
    cin>>a;
    system("cls");
    if(a==1||a==2||a==3)
    {
        cout<<"那就去死"<<endl;
        Sleep(857);
        system("cls");
        M();
    }
    else
    {
        for(int i=1;i<=5;i++)
        {
            cout<<"@"<<endl;
            Sleep(1000);
        }
        system("cls");
        cout<<"还挺聪明"<<endl;
        cout<<"猜猜我的出生月份"<<endl;
        cout<<"1:1月,2:3月,3:5月,4:7月,5:12月"<<endl;
        int b;
        cin>>b;
        system("cls");
        if(b!=1)
        {
            cout<<"猜错了,那就去死"<<endl;
            Sleep(857);
            system("cls");
            M();
        }
        else
        {
            for(int i=1;i<=8;i++)
            {
                cout<<"@"<<endl;
                Sleep(1000);
            }
            system("cls");
            cout<<"挺厉害嘛"<<endl;
            cout<<"不知道能不能挺过这一关"<<endl;
            cout<<"请输入密码"<<endl;
            int c;
            cin>>c;
            system("cls");
            if(c!=128164/2/179)
            {
                cout<<"猜错了,那就去死"<<endl;
                Sleep(857);
                system("cls");
                M();
            }
            else
            {
                cout<<"居然挺过来了"<<endl;
                cout<<"准备下一关"<<endl;
                cout<<"1+1=?"<<endl;
                cout<<"1:1,2:2,3:3,4:5"<<endl;
                int d;
                if(d==1||d==2||d==3||d==4)
                {
                    cout<<"失败了,那就去死"<<endl;
                    Sleep(857);
                    system("cls");
                    M();
                }
                else if(d!=5)
                {
                    cout<<"失败了,那就去死"<<endl;
                    Sleep(857);
                    system("cls");
                    M();
                }
                else
                {
                    cout<<"最后一关"<<endl;
                    cout<<"猜猜我名字有夺少笔画"<<endl;
                    cout<<"1:18,2:24,3:30,4:36,5:42"<<endl;
                    int e;
                    cin>>e;
                    if(e==1)
                    {
                        cout<<"猜错了,那就去死"<<endl;
                        Sleep(857);
                        system("cls");
                        M();
                    }
                    else if(e==3)
                    {
                        cout<<"猜错了,那就去死"<<endl;
                        Sleep(857);
                        system("cls");
                        M();
                    }
                    else if(e==4)
                    {
                        cout<<"猜错了,那就去死"<<endl;
                        Sleep(857);
                        system("cls");
                        M();
                    }
                    else if(e==5)
                    {
                        cout<<"猜错了,那就去死"<<endl;
                        Sleep(857);
                        system("cls");
                        M();
                    }
                    else if(e!=2)
                    {
                        cout<<"恭喜恭喜"<<endl;
                        cout<<"游戏结束"<<endl;
                        return 0;
                    }
                    else 
                    {
                        cout<<"猜错了,那就去死"<<endl;
                        Sleep(857);
                        system("cls");
                        M();
                    }
                }
            }
        } 
    }
    return 0;
}


                    
 

  • 17
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值