c++抽卡游戏v1.0

· · 休闲·娱乐


#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
const int Height = 19, Width = 19;
#define Wall 1
#define Road 0
#define Start 2
#define End 3
#define Esc 5
#define Up 1
#define Down 2
#define Left 3
#define Right 4
using namespace std;
const int N = 1000;
double n = 100;
int jian;
int h1, h2, h3, h4, h5, hz, z1, z2, z3, z4, z5, z6, z7, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10;
struct card {
    string name;
    int lv1, lv2, lv3, lv4, lv5, lv6, lv7, lv8, lv9, lv10, lv11;
} a[N];
int mpp[Height+2][Width+2];
void read() {
    ifstream in("card.txt");
    if (!in) {
        cerr << "无法打开文件!" << endl;
        return;
    }
    in >> n;
    for (int i = 1; i <= 179; i++) {
        in >> a[i].name
           >> a[i].lv1 >> a[i].lv2 >> a[i].lv3
           >> a[i].lv4 >> a[i].lv5 >> a[i].lv6
           >> a[i].lv7 >> a[i].lv8 >> a[i].lv9
           >> a[i].lv10 >> a[i].lv11;
    }
    in >> h1 >> h2 >> h3 >> h4 >> h5
       >> b1 >> b2 >> b3 >> b4 >> b5
       >> hz >> z1 >> z2 >> z3 >> z4 >> z5 >> z6 >> z7
       >> b6 >> b7 >> b8 >> b9 >> b10;
    in.close();
}
void save() {
    ofstream out("card.txt");
    if (!out) {
        cerr << "无法打开文件进行写入!" << endl;
        return;
    }
    out << n << ' ';
    for (int i = 1; i <= 179; i++) {
        out << a[i].name << ' '
            << a[i].lv1 << ' ' << a[i].lv2 << ' ' << a[i].lv3 << ' '
            << a[i].lv4 << ' ' << a[i].lv5 << ' ' << a[i].lv6 << ' '
            << a[i].lv7 << ' ' << a[i].lv8 << ' ' << a[i].lv9 << ' '
            << a[i].lv10 << ' ' << a[i].lv11 << ' ';
    }
    out << h1 << ' ' << h2 << ' ' << h3 << ' ' << h4 << ' ' << h5 << ' '
        << b1 << ' ' << b2 << ' ' << b3 << ' ' << b4 << ' ' << b5 << ' '
        << hz << ' ' << z1 << ' ' << z2 << ' ' << z3 << ' ' << z4 << ' '
        << z5 << ' ' << z6 << ' ' << z7 << ' '
        << b6 << ' ' << b7 << ' ' << b8 << ' ' << b9 << ' ' << b10 << ' ';
    out.close();
}

void cls() {
    system("cls");
}
void pause() {
    cout << "请按任意键继续...\n";
    char c = getch();
}
void tt() {
    cout << "一一一一一一抽卡v1.0一一一一一一\n";
}
void goto_xy(int x,int y) { //移动坐标
    COORD coord;
    coord.X=x;
    coord.Y=y;
    SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), coord );
}
void hidden() { //隐藏光标
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_CURSOR_INFO cci;
    GetConsoleCursorInfo(hOut,&cci);
    cci.bVisible=0;//赋1为显示,赋0为隐藏
    SetConsoleCursorInfo(hOut,&cci);
}
void create(int x,int y) { //随机生成迷
    int c[4][2]= {0,1,1,0,0,-1,-1,0}; //四个方向
    int i,j,t;
//将方向打乱
    for(i=0; i<4; i++) {
        j=rand()%4;
        t=c[i][0];
        c[i][0]=c[j][0];
        c[j][0]=t;
        t=c[i][1];
        c[i][1]=c[j][1];
        c[j][1]=t;
    }
    mpp[x][y]=Road;
    for(i=0; i<4; i++)
        if(mpp[x+2*c[i][0]][y+2*c[i][1]]==Wall) {
            mpp[x+c[i][0]][y+c[i][1]]=Road;
            create(x+2*c[i][0],y+2*c[i][1]);
        }
}
int get_key() { //接收按键
    char c;
    while(c=getch()) {
        if(c==27) return Esc; //Esc
        if(c!=-32)continue;
        c=getch();
        if(c==72) return Up; //上
        if(c==80) return Down; //下
        if(c==75) return Left; //左
        if(c==77) return Right; //右
    }
    return 0;
}
void paint(int x,int y) { //画迷宫
    goto_xy(2*y-2,x-1);
    switch(mpp[x][y]) {
        case Start:
            printf("入");
            break; //画入口
        case End:
            printf("出");
            break; //画出口
        case Wall:
            printf("▇");
            break; //画墙
        case Road:
            printf("  ");
            break; //画路
    }
}
void game() {
    int x=2,y=1; //玩家当前位置,刚开始在入口处
    int c; //用来接收按键
    while(1) {
        goto_xy(2*y-2,x-1);
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
        printf("▇▇"); //画出玩家当前位置
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_GREEN);

        if(mpp[x][y]==End) { //判断是否到达出口
            goto_xy(30,24);
            if (jian == 0) {
                printf("到达终点,获得奖励 10元钱\n");
                n+=10;
                save();
            } else if (jian == 4) {
                printf("到达终点,获得奖励 7元钱\n");
                n+=7;
                save();
            } else if (jian == 9) {
                printf("到达终点,获得奖励 5元钱\n");
                n+=5;
                save();
            }
            save();
            pause();
            char ccc;
            ccc = getch();
            return ;
        }
        c=get_key();
        if(c==Esc) {
            goto_xy(0,24);
            break;
        }
        switch(c) {
            case Up: //向上走
                if(mpp[x-1][y]!=Wall) {
                    paint(x,y);
                    x--;
                }
                break;
            case Down: //向下走
                if(mpp[x+1][y]!=Wall) {
                    paint(x,y);
                    x++;
                }
                break;
            case Left: //向左走
                if(mpp[x][y-1]!=Wall) {
                    paint(x,y);
                    y--;
                }
                break;
            case Right: //向右走
                if(mpp[x][y+1]!=Wall) {
                    paint(x,y);
                    y++;
                }
                break;
        }
    }
}
void zoumigong(char c) {
    if (c == '1') jian = 9;
    if (c == '2') jian = 4;
    if (c == '3') jian = 0;
    int i,j;
    srand((unsigned)time(NULL)); //初始化随即种子
    hidden(); //隐藏光标
    for(i=0; i<=Height+1-jian; i++)
        for(j=0; j<=Width+1-jian; j++)
            if(i==0||i==Height+1-jian||j==0||j==Width+1-jian) //初始化迷宫
                mpp[i][j]=Road;
            else mpp[i][j]=Wall;
    create(2*(rand()%(Height/2-jian)+1),2*(rand()%(Width/2-jian)+1)); //从随机一个点开始生成迷宫,该点行列都为偶数
    for(i=0; i<=Height+1-jian; i++) { //边界处理
        mpp[i][0]=Wall;
        mpp[i][Width+1-jian]=Wall;
    }
    for(j=0; j<=Width+1-jian; j++) { //边界处理
        mpp[0][j]=Wall;
        mpp[Height+1-jian][j]=Wall;
    }
    mpp[2][1]=Start; //给定入口
    mpp[Height-1-jian][Width-jian]=End; //给定出口
    for(i=1; i<=Height-jian; i++)
        for(j=1; j<=Width-jian; j++) //画出迷宫
            paint(i,j);
    game(); //开始游戏
    getch();
}
void init() {
    a[1].name = "云        ";
    a[2].name = "晴天      ";
    a[3].name = "梦之队    ";
    a[4].name = "热带潮汐  ";
    a[5].name = "蜜境      ";
    a[6].name = "山丘      ";
    a[7].name = "星域      ";
    a[8].name = "冬日      ";
    a[9].name = "海啸      ";
    a[10].name = "原子能    ";
    a[11].name = "幻想      ";
    a[12].name = "启明星    ";
    a[13].name = "骷髅派对  ";
    a[14].name = "蛛网      ";
    a[15].name = "荷鲁斯之眼";
    a[16].name = "南瓜灯    ";
    a[17].name = "永恒      ";
    a[18].name = "空间站    ";
    a[19].name = "小丑乐园  ";
    a[20].name = "车间      ";
    a[21].name = "音·悦     ";//1 star END && yin·yue
    a[22].name = "天空      ";
    a[23].name = "旷野余韵  ";
    a[24].name = "激光之城  ";
    a[25].name = "狂热派对  ";
    a[26].name = "童话      ";
    a[27].name = "雪夜      ";
    a[28].name = "幻影阵    ";
    a[29].name = "万圣节逃生";
    a[30].name = "金色圣诞节";
    a[31].name = "立方工坊  ";
    a[32].name = "极速挑战  ";
    a[33].name = "庙会      ";
    a[34].name = "8比特     ";
    a[35].name = "星辰      ";
    a[36].name = "灯神      ";
    a[37].name = "樱落      ";
    a[38].name = "Alone_Remix";
    a[39].name = "王牌      ";
    a[40].name = "荒区      ";
    a[41].name = "永恒之旅  ";//yong heng zhi lv
    a[42].name = "炫光      ";
    a[43].name = "桑巴      ";
    a[44].name = "影武士    ";
    a[45].name = "绿茵战场  ";
    a[46].name = "武林      ";//2 star END
    a[47].name = "双子星    ";
    a[48].name = "时光机    ";
    a[49].name = "蓄能器    ";
    a[50].name = "海底世界  ";
    a[51].name = "森林(A版) ";
    a[52].name = "赞歌      ";
    a[53].name = "Faded     ";
    a[54].name = "迷踪      ";
    a[55].name = "森林(B版) ";
    a[56].name = "图腾      ";
    a[57].name = "冠军赛    ";
    a[58].name = "焰火      ";
    a[59].name = "Faded_Remix";
    a[60].name = "对弈纵横  ";
    a[61].name = "亡灵之舞  ";
    a[62].name = "捣蛋节    ";
    a[63].name = "沙漠      ";
    a[64].name = "糖果      ";
    a[65].name = "彼岸      ";
    a[66].name = "功夫      ";
    a[67].name = "彩虹城堡  ";
    a[68].name = "海盗船    ";
    a[69].name = "午夜巡游  ";
    a[70].name = "深渊陷阱  ";
    a[71].name = "钢铁洪流  ";
    a[72].name = "巴西狂欢节";
    a[73].name = "机动核心  ";
    a[74].name = "电玩城    ";
    a[75].name = "解锁未来  ";
    a[76].name = "Alone     ";
    a[77].name = "峡谷奇遇  ";
    a[78].name = "矩阵浪潮  ";
    a[79].name = "奇妙甜品屋";
    a[80].name = "周年庆    ";//zhong nian qing
    a[81].name = "重生      ";//3 star END && chong sheng
    a[82].name = "火山      ";
    a[83].name = "圣诞福音  ";
    a[84].name = "风雨同行  ";
    a[85].name = "西部      ";
    a[86].name = "美食诱惑  ";
    a[87].name = "战斗堡垒  ";
    a[88].name = "动感方块  ";
    a[89].name = "雾都      ";
    a[90].name = "格赫罗斯  ";
    a[91].name = "殿堂遗址  ";
    a[92].name = "精灵镇    ";
    a[93].name = "数码方阵  ";
    a[94].name = "极光之旅  ";
    a[95].name = "灼热未来  ";
    a[96].name = "王国战争  ";
    a[97].name = "VR幻境    ";
    a[98].name = "城市      ";
    a[99].name = "科技      ";
    a[100].name = "酋长      ";
    a[101].name = "废土狂沙  ";
    a[102].name = "星际跃迁  ";
    a[103].name = "俄罗斯方块";
    a[104].name = "马戏团    ";
    a[105].name = "雷鬼      ";
    a[106].name = "炽热赛道  ";
    a[107].name = "海战      ";
    a[108].name = "晨光熹微  ";
    a[109].name = "遗迹      ";
    a[110].name = "百变圣诞夜";
    a[111].name = "迷城      ";
    a[112].name = "街头篮球  ";
    a[113].name = "亡灵节    ";
    a[114].name = "落日余晖  ";
    a[115].name = "Alone_II  ";
    a[116].name = "恶灵群舞  ";
    a[117].name = "枢纽      ";
    a[118].name = "竞速传奇  ";
    a[119].name = "热恋      ";
    a[120].name = "怪物城市  ";
    a[121].name = "生日派对  ";//sheng ri pai dui
    a[122].name = "The_Spectre";
    a[123].name = "恐龙迪斯科";
    a[124].name = "22号禁区  ";
    a[125].name = "克苏鲁    ";//4 star END
    a[126].name = "时间      ";
    a[127].name = "机甲      ";
    a[128].name = "神灯      ";
    a[129].name = "埃及      ";
    a[130].name = "音律派对  ";
    a[131].name = "棋城要塞  ";
    a[132].name = "裂变      ";
    a[133].name = "游乐园    ";
    a[134].name = "积木      ";
    a[135].name = "天空之城  ";
    a[136].name = "万圣节    ";
    a[137].name = "工业基地  ";
    a[138].name = "花舞      ";
    a[139].name = "机械动力  ";
    a[140].name = "翡翠城    ";
    a[141].name = "开普勒的梦";
    a[142].name = "春节      ";
    a[143].name = "微芯片    ";
    a[144].name = "视界巡航  ";
    a[145].name = "海洋      ";
    a[146].name = "电子迷宫  ";
    a[147].name = "深空      ";
    a[148].name = "绿野仙踪  ";
    a[149].name = "扑克      ";
    a[150].name = "驯鹿之礼  ";
    a[151].name = "万圣嘉年华";
    a[152].name = "圣诞      ";
    a[153].name = "鬼侍      ";
    a[154].name = "霓虹      ";
    a[155].name = "橄榄球    ";
    a[156].name = "The_Spectre_Remix";
    a[157].name = "机械玩具  ";
    a[158].name = "蒸汽时代  ";
    a[159].name = "迷幻音浪  ";
    a[160].name = "怪盗      ";
    a[161].name = "恐龙谷    ";
    a[162].name = "像素      ";
    a[163].name = "赤色帝国  ";
    a[164].name = "笙·宴     ";//sheng·yan
    a[165].name = "开心      ";
    a[166].name = "世界杯    ";
    a[167].name = "落日剑冢  ";
    a[168].name = "魔法屋    ";
    a[169].name = "竞技乐园  ";
    a[170].name = "管道      ";
    a[171].name = "几何迷阵  ";//5 star END
    a[172].name = "新年      ";
    a[173].name = "万圣惊魂夜";
    a[174].name = "涅槃      ";//nie pan
    a[175].name = "生日快乐  ";//sheng ri
    a[176].name = "电·爱     ";//dian ai
    a[177].name = "四周年    ";//4nian
    a[178].name = "玉兔祥云  ";
    a[179].name = "时·忆     ";//shi·yi
}
void no() {
    cout << "钱不够!";
    Sleep(910);
}
void year() {
    while (1) {
        save();
        cls();
        tt();
        cout << "  名称       包数   价格\n";
        cout << "1.生日快乐盒 单盒   396.33元\n";
        cout << "2.四周年礼盒 4包    444.44元\n";
        cout << "3.六年的回忆 2包    526.56元\n";
        cout << "4.七年之梦盒 3包    477.37元\n";
        cout << "5.电·爱之盒  单盒   462.21元\n";
        cout << "6.涅槃·重生  2包    500.99元\n";
        cout << "7.Time-Mory  10包   491.10元\n";
        cout << "8.返回上一页\n";
        char c = getch();
        if (c == '1') {
            if (n < 396.33) {
                no();
                continue;
            }
            z1++;
            n-=396.33;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '2') {
            if (n < 444.44) {
                no();
                continue;
            }
            z2++;
            n-=444.44;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '3') {
            if (n < 526.56) {
                no();
                continue;
            }
            z3++;
            n-=526.56;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '4') {
            if (n < 477.37) {
                no();
                continue;
            }
            z4++;
            n-=477.37;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '5') {
            if (n < 462.21) {
                no();
                continue;
            }
            z5++;
            n-=462.21;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '6') {
            if (n < 500.99) {
                no();
                continue;
            }
            z6++;
            n-=500.99;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '7') {
            if (n < 491.10) {
                no();
                continue;
            }
            z7++;
            n-=491.10;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '8') return ;
    }
}
void big() {
    while (1) {
        save();
        cls();
        tt();
        cout << "  名称    包数   价格\n";
        cout << "1.萌新盒  36包   68.00元\n";
        cout << "2.重生盒  30包   91.78元\n";
        cout << "3.经典盒  30包   114.50元\n";
        cout << "4.传奇盒  30包   150.22元\n";
        cout << "5.荣耀盒  30包   186.25元\n";
        cout << "按6返回上一页\n";
        char c = getch();
        if (c == '1') {
            if (n < 68.00) {
                no();
                continue;
            }
            h1++;
            n-=68.00;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '2') {
            if (n < 91.78) {
                no();
                continue;
            }
            h2++;
            n-=91.78;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '3') {
            if (n < 114.50) {
                no();
                continue;
            }
            h3++;
            n-=114.50;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '4') {
            if (n < 150.22) {
                no();
                continue;
            }
            h4++;
            n-=150.22;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '5') {
            if (n < 186.25) {
                no();
                continue;
            }
            h5++;
            n-=186.25;
            save();
            cout << "购买成功!\n";
            Sleep(1000);
        } else if (c == '6') return ;
    }
}
void small() {
    while (1) {
        save();
        cls();
        tt();
        cout << "你现在有" << n << "元\n";
        cout << "你要买什么?按0返回上一页\n";
        cout << "1.一元(萌新)包\n";
        cout << "2.二元(重生)包\n";
        cout << "3.三元(经典)包\n";
        cout << "4.五元(传奇)包\n";
        cout << "5.十元(荣耀)包\n";
        char c = getch();
        if (c == '1') {
            save();
            cls();
            tt();
            cout << "你要买几包?按0返回上一页\n";
            int x;
            cin >> x;
            if (x > n) {
                cout << "\n你没有那么多钱...\n";
                Sleep(1000);
                continue;
            }
            n -= x;
            b1 += x;
            save();
            cout << "\n购买成功!\n";
            pause();
        } else if (c == '2') {
            save();
            cls();
            tt();
            cout << "你要买几包?按0返回上一页\n";
            int x;
            cin >> x;
            if (x * 2 > n) {
                cout << "\n你没有那么多钱...\n";
                Sleep(1000);
                continue;
            }
            n -= x * 2;
            b2 += x;
            save();
            cout << "\n购买成功!\n";
            pause();
        } else if (c == '3') {
            save();
            cls();
            tt();
            cout << "你要买几包?按0返回上一页\n";
            int x;
            cin >> x;
            if (x * 3 > n) {
                cout << "\n你没有那么多钱...\n";
                Sleep(1000);
                continue;
            }
            n -= x * 3;
            b3 += x;
            save();
            cout << "\n购买成功!\n";
            pause();
        } else if (c == '4') {
            save();
            cls();
            tt();
            cout << "你要买几包?按0返回上一页\n";
            int x;
            cin >> x;
            if (x * 5 > n) {
                cout << "\n你没有那么多钱...\n";
                Sleep(1000);
                continue;
            }
            n -= x * 5;
            b4 += x;
            save();
            cout << "\n购买成功!\n";
            pause();
        } else if (c == '5') {
            save();
            cls();
            tt();
            cout << "你要买几包?按0返回上一页\n";
            int x;
            cin >> x;
            if (x * 10 > n) {
                cout << "\n你没有那么多钱...\n";
                Sleep(1000);
                continue;
            }
            n -= x * 10;
            b5 += x;
            save();
            cout << "\n购买成功!\n";
            pause();
        } else if (c == '0') break;
    }
}
void buy_card() {
    while (1) {
        save();
        cls();
        tt();
        cout << "你想买什么卡?\n";
        cout << "1.整盒 2.周年类(暂无法抽,别买) 3.单包 0.返回上一页\n";
        char c = getch();
        if (c == '1') big();
        if (c == '2') year();
        if (c == '3') small();
        if (c == '0') return ;
    }
}
void bao() {
    while (1) {
        save();
        cls();
        tt();
        cout << "当前卡包数量:\n";
        cout << "1.一元包" << b1 << "包,\n";
        cout << "2.二元包" << b2 << "包,\n";
        cout << "3.三元包" << b3 << "包,\n";
        cout << "4.五元包" << b4 << "包,\n";
        cout << "5.十元包" << b5 << "包,\n";
        cout << "6.四周年包" << b6 << "包,\n";
        cout << "7.六周年包" << b7 << "包,\n";
        cout << "8.七周年包" << b8 << "包,\n";
        cout << "9.九周年包" << b9 << "包,\n";
        cout << "10.十周年包" << b10 << "包\n";
        cout << "按0返回上一页\n";
        cout << "你要拆?\n";
        char c = getch();
        int x;
        if (c == '1') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << b1 << "包一元包\n";
                cout << "你要拆几包?按0退出\n";
                cin >> x;
                if (x == 0) break;
                if (x > b1) {
                    cout << "\n你没有那么多包\n";
                    Sleep(1000);
                    continue;
                }
                cout << "\n开始拆喽~\n";
                b1 -= x;
                save();
                Sleep(750);
                cls();
                tt();
                int rd, now = 1;
                bool gp = false;
                for (int i = 1; i <= x; i++) {
                    if (i % 36 == 0) gp = false;
                    cout << "第" << now << "包\n";
                    now++;
                    rd = rand() * time(0) % 179 + 1;
                    cout << "第一张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() + rand() % 78 + 1) * time(0) % 179 + 1;
                    cout << "第二张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = time(0) * time(0) % 179 + 1;
                    cout << "第三张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * (time(0) + now) % 179 + 1;
                    cout << "第四张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() % 5 + 1) * time(0) * now % 179 + 1;
                    cout << "第五张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand()% 1000 + 1) * rand() % 179 + 1;
                    cout << "第六张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * ((time(0) * now) % 250 + 1) % 179 + 1;
                    cout << "第七张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    int isgp = ((((rand() * time(0)) % 250 + 1) + time(0) * 2) * rand()) % 36 + 1;
                    rd = rand() * ((time(0) * rand()) % 250 + 1) % 179 + 1;
                    if (isgp == 1 && !gp) {
                        cout << "第八张:" << a[rd].name << "--GP卡\n";
                        a[rd].lv9++;
                        save();
                        gp = true;
                    } else if (isgp > 30) {
                        cout << "第八张:" << a[rd].name << "--SSR卡\n";
                        a[rd].lv3++;
                        save();
                    } else {
                        cout << "第八张:" << a[rd].name << "--SR卡\n";
                        a[rd].lv2++;
                        save();
                    }
                    pause();
                }
            }
        } else if (c == '2') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << b2 << "包二元包\n";
                cout << "你要拆几包?按0退出\n";
                cin >> x;
                if (x == 0) break;
                if (x > b2) {
                    cout << "\n你没有那么多包\n";
                    Sleep(1000);
                    continue;
                }
                cout << "\n开始拆喽~\n";
                b2 -= x;
                save();
                Sleep(750);
                cls();
                tt();
                int rd, now = 1;
                bool CR = false, ur1 = false, ur2 = false;
                for (int i = 1; i <= x; i++) {
                    if (i % 30 == 0)
                        CR = ur1 = ur2 = false;
                    cout << "第" << now << "包\n";
                    now++;
                    rd = rand() * time(0) % 179 + 1;
                    cout << "第一张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() + rand() % 78 + 1) * time(0) % 179 + 1;
                    cout << "第二张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = time(0) * time(0) % 179 + 1;
                    cout << "第三张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * (time(0) + now) % 179 + 1;
                    cout << "第四张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() % 5 + 1) * time(0) * now % 179 + 1;
                    cout << "第五张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand()% 1000 + 1) * rand() % 179 + 1;
                    cout << "第六张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * ((time(0) * now) % 250 + 1) % 179 + 1;
                    cout << "第七张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    int iscr = ((((rand() * time(0)) % 250 + 1) + time(0) * 2) * rand()) % 30 + 1;
                    rd = rand() * ((time(0) * rand()) % 250 + 1) % 179 + 1;
                    if (iscr == 1 && !CR) {
                        cout << "第八张:" << a[rd].name << "--CR卡\n";
                        a[rd].lv8++;
                        save();
                        CR = true;
                    } else if (iscr > 28 && (!ur1 || !ur2)) {
                        cout << "第八张:" << a[rd].name << "--UR卡\n";
                        a[rd].lv4++;
                        save();
                    } else if (iscr > 9 && iscr < 14) {
                        cout << "第八张:" << a[rd].name << "--SSR卡\n";
                        a[rd].lv3++;
                        save();
                    } else {
                        cout << "第八张:" << a[rd].name << "--SR卡\n";
                        a[rd].lv2++;
                        save();
                    }
                    pause();
                }
            }
        } else if (c == '3') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << b3 << "包三元包\n";
                cout << "你要拆几包?按0退出\n";
                cin >> x;
                if (x == 0) break;
                if (x > b3) {
                    cout << "\n你没有那么多包\n";
                    Sleep(1000);
                    continue;
                }
                cout << "\n开始拆喽~\n";
                b3 -= x;
                save();
                Sleep(750);
                cls();
                tt();
                int rd, now = 1;
                bool lr = false, ur1 = false, ur2 = false;
                for (int i = 1; i <= x; i++) {
                    if (i % 24 == 0) lr = ur1 = ur2 = false;
                    cout << "第" << now << "包\n";
                    now++;
                    rd = rand() * time(0) % 179 + 1;
                    cout << "第一张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() + rand() % 78 + 1) * time(0) % 179 + 1;
                    cout << "第二张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = time(0) * time(0) % 179 + 1;
                    cout << "第三张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * (time(0) + now) % 179 + 1;
                    cout << "第四张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() % 5 + 1) * time(0) * now % 179 + 1;
                    cout << "第五张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand()% 1000 + 1) * rand() % 179 + 1;
                    cout << "第六张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * ((time(0) * now) % 250 + 1) % 179 + 1;
                    cout << "第七张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    int islr = ((((rand() * time(0)) % 250 + 1) + time(0) * 2) * rand()) % 24 + 1;
                    rd = rand() * ((time(0) * rand()) % 250 + 1) % 179 + 1;
                    if (islr == 1 && !lr) {
                        cout << "第八张:" << a[rd].name << "--LR卡\n";
                        a[rd].lv7++;
                        save();
                        lr = true;
                    } else if (islr > 22 && (!ur1 || !ur2)) {
                        cout << "第八张:" << a[rd].name << "--UR卡\n";
                        a[rd].lv4++;
                        save();
                    } else if (islr > 9 && islr < 14) {
                        cout << "第八张:" << a[rd].name << "--SSR卡\n";
                        a[rd].lv3++;
                        save();
                    } else {
                        cout << "第八张:" << a[rd].name << "--SR卡\n";
                        a[rd].lv2++;
                        save();
                    }
                    pause();
                }
            }
        } else if (c == '4') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << b4 << "包五元包\n";
                cout << "你要拆几包?按0退出\n";
                cin >> x;
                if (x == 0) break;
                if (x > b4) {
                    cout << "\n你没有那么多包\n";
                    Sleep(1000);
                    continue;
                }
                cout << "\n开始拆喽~\n";
                b4 -= x;
                save();
                Sleep(750);
                cls();
                tt();
                int rd, now = 1;
                bool hr = false;
                for (int i = 1; i <= x; i++) {
                    if (i % 24 == 0) hr= false;
                    cout << "第" << now << "包\n";
                    now++;
                    rd = rand() * time(0) % 179 + 1;
                    cout << "第一张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() + rand() % 78 + 1) * time(0) % 179 + 1;
                    cout << "第二张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = time(0) * time(0) % 179 + 1;
                    cout << "第三张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * (time(0) + now) % 179 + 1;
                    cout << "第四张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() % 5 + 1) * time(0) * now % 179 + 1;
                    cout << "第五张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand()% 1000 + 1) * rand() % 179 + 1;
                    cout << "第六张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * ((time(0) * now) % 250 + 1) % 179 + 1;
                    cout << "第七张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    int ishr = ((((rand() * time(0)) % 250 + 1) + time(0) * 2) * rand()) % 24 + 1;
                    rd = rand() * ((time(0) * rand()) % 250 + 1) % 179 + 1;
                    if (ishr == 1 && !hr) {
                        cout << "第八张:" << a[rd].name << "--HR卡\n";
                        a[rd].lv5++;
                        save();
                        hr = true;
                    } else if (ishr > 22) {
                        cout << "第八张:" << a[rd].name << "--UR卡\n";
                        a[rd].lv4++;
                        save();
                    } else if (ishr > 9 && ishr < 14) {
                        cout << "第八张:" << a[rd].name << "--SSR卡\n";
                        a[rd].lv3++;
                        save();
                    } else {
                        cout << "第八张:" << a[rd].name << "--SR卡\n";
                        a[rd].lv2++;
                        save();
                    }
                    pause();
                }
            }
        } else if (c == '5') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << b5 << "包十元包\n";
                cout << "你要拆几包?按0退出\n";
                cin >> x;
                if (x == 0) break;
                if (x > b5) {
                    cout << "\n你没有那么多包\n";
                    Sleep(1000);
                    continue;
                }
                cout << "\n开始拆喽~\n";
                b5 -= x;
                save();
                Sleep(750);
                cls();
                tt();
                int rd, now = 1;
                bool shr = false, zr1 = false, zr2 = false;
                for (int i = 1; i <= x; i++) {
                    if (i % 24 == 0) shr = zr1 = zr2 = false;
                    cout << "第" << now << "包\n";
                    now++;
                    rd = rand() * time(0) % 179 + 1;
                    cout << "第一张:" << a[rd].name << "--HR卡\n";
                    a[rd].lv5++;
                    save();
                    rd = (rand() + rand() % 78 + 1) * time(0) % 179 + 1;
                    cout << "第二张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = time(0) * time(0) % 179 + 1;
                    cout << "第三张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * (time(0) + now) % 179 + 1;
                    cout << "第四张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand() % 5 + 1) * time(0) * now % 179 + 1;
                    cout << "第五张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = (rand()% 1000 + 1) * rand() % 179 + 1;
                    cout << "第六张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    rd = rand() * ((time(0) * now) % 250 + 1) % 179 + 1;
                    cout << "第七张:" << a[rd].name << "--R卡\n";
                    a[rd].lv1++;
                    save();
                    int isshr = ((((rand() * time(0)) % 250 + 1) + time(0) * 2) * rand()) % 24 + 1;
                    rd = rand() * ((time(0) * rand()) % 250 + 1) % 179 + 1;
                    if (isshr == 1 && !shr) {
                        cout << "第八张:" << a[rd].name << "--SHR卡\n";
                        a[rd].lv10++;
                        save();
                        shr = true;
                    } else if (isshr > 22 && (!zr1 || !zr2)) {
                        cout << "第八张:" << a[rd].name << "--ZR卡\n";
                        a[rd].lv6++;
                        save();
                    } else if (isshr > 19 && isshr < 23) {
                        cout << "第八张:" << a[rd].name << "--UR卡\n";
                        a[rd].lv4++;
                        save();
                    } else if (isshr > 9 && isshr < 14) {
                        cout << "第八张:" << a[rd].name << "--SSR卡\n";
                        a[rd].lv3++;
                        save();
                    } else {
                        cout << "第八张:" << a[rd].name << "--SR卡\n";
                        a[rd].lv2++;
                        save();
                    }
                    pause();
                }
            }
        } else if (c == '0') break;
    }
}
void hezi() {
    while (1) {
        cls();
        tt();
        cout << "当前盒子数量:\n";
        cout << "1.萌新盒:" << h1 << "盒\n";
        cout << "2.重生盒:" << h2 << "盒\n";
        cout << "3.经典盒:" << h3 << "盒\n";
        cout << "4.传奇盒:" << h4 << "盒\n";
        cout << "5.荣耀盒:" << h5 << "盒\n";
        cout << "6.生日快乐盒:" << z1 << "盒\n";
        cout << "7.四周年礼盒:" << z2 << "盒\n";
        cout << "8.六年的回忆:" << z3 << "盒\n";
        cout << "9.七年之梦盒:" << z4 << "盒\n";
        cout << "10.电·爱之盒:" << z5 << "盒\n";
        cout << "11.涅槃·重生:" << z6 << "盒\n";
        cout << "12.Time-Mory盒:" << z7 << "盒\n";
        cout << "你要拆?按0退出\n";
        char c = getch();
        int x;
        if (c == '1') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << h1 << "盒萌新盒\n";
                cout << "你要拆几盒?按0返回上一页\n";
                cin >> x;
                if (x == 0) break;
                if (h1 < x) {
                    cout << "\n你没那么多..\n";
                    Sleep(1000);
                    continue;
                }
                b1 += x * 36;
                h1 -= x;
                save();
                cout << "\n你拆了" << x << "盒萌新盒\n";
                cout << "获得一元包" << x * 36 << "包\n";
                pause();
                break;
            }
        } else if (c == '2') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << h2 << "盒重生盒\n";
                cout << "你要拆几盒?按0返回上一页\n";
                cin >> x;
                if (x == 0) break;
                if (h2 < x) {
                    cout << "\n你没那么多..\n";
                    Sleep(1000);
                    continue;
                }
                b2 += x * 30;
                h2 -= x;
                save();
                cout << "\n你拆了" << x << "盒重生盒\n";
                cout << "获得二元包" << x * 30 << "包\n";
                pause();
                break;
            }
        } else if (c == '3') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << h3 << "盒经典盒\n";
                cout << "你要拆几盒?按0返回上一页\n";
                cin >> x;
                if (x == 0) break;
                if (h3 < x) {
                    cout << "\n你没那么多..\n";
                    Sleep(1000);
                    continue;
                }
                b3 += x * 24;
                h3 -= x;
                save();
                cout << "\n你拆了" << x << "盒经典盒\n";
                cout << "获得三元包" << x * 24 << "包\n";
                pause();
                break;
            }
        } else if (c == '4') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << h4 << "盒传奇盒\n";
                cout << "你要拆几盒?按0返回上一页\n";
                cin >> x;
                if (x == 0) break;
                if (h4 < x) {
                    cout << "\n你没那么多..\n";
                    Sleep(1000);
                    continue;
                }
                b4 += x * 24;
                h4 -= x;
                cout << "\n你拆了" << x << "盒传奇盒\n";
                cout << "获得五元包" << x * 24 << "包\n";
                pause();
                break;
            }
        } else if (c == '5') {
            while (1) {
                cls();
                tt();
                cout << "你现在有" << h5 << "盒荣耀盒\n";
                cout << "你要拆几盒?按0返回上一页\n";
                cin >> x;
                if (x == 0) break;
                if (h5 < x) {
                    cout << "\n你没那么多..\n";
                    Sleep(1000);
                    continue;
                }
                b5 += x * 24;
                h5 -= x;
                cout << "\n你拆了" << x << "盒荣耀盒\n";
                cout << "获得十元包" << x * 24 << "包\n";
                pause();
                break;
            }
        } else if (c == '0') break;
        pause();
    }
}
void demolish_card() {
    while (1) {
        cls();
        tt();
        save();
        cout << "你要干什么?1.拆卡 2.拆盒 3.返回上一页\n";
        char c = getch();
        if (c == '1')
            bao();
        else if (c == '2')
            hezi();
        else break;
    }
}
void dz(){ 
    system("cls");                                                    //打字赚钱分页 
    cout<<"欢迎来到打字赚钱!给你一串英文字符,你应该打出一样的一串英文字符,每个字符2元,有一个字母错误则什么也无法获得!\n";
    srand(time(0));
    int x;
    cout<<"按1开始,其他键退出\n";
    cin>>x;
    if (x!=1) return;
    string s,s2;
    int i,t;                                             //x=字数 ,t随机 
    cout<<"你要打几个字?最多100个"<<endl;
    cin>>x;
    if (x<1 || x>100){
        cout<<"字数错误,请重新输入"<<endl;
        cout<<"按任意键继续"<<endl; 
        cin>>x;
        dz(); 
    } 
    for (i=0;i<x;i++){
        t=rand()%2;
        if (t==0){
            t=rand()%26+'A';
            s+=char(t);
        }
        if (t==1){
            t=rand()%26+'a';
            s+=char(t);
        }
    } 
    cout<<"请照打!"<<s;
    cin>>s2;
    if (s==s2){
        cout<<"输对了,获得"<<x*2<<"元。"<<endl;
        n+=x*2; 
    } 
    else {
        cout<<"输错了,你什么也没有得到。"<<endl; 
    }
    save();
    pause();
} 
void js(){                            //计算赚钱 
    system("cls");                                            
    cout<<"欢迎来到计算赚钱!做出计算题的答案即可!一道题5元!\n";
    int a,b,i,c,n,l,ans,q;
    cout<<"按1开始,其他键退出\n";
    cin>>l;
    if (l!=1) return;
    cout<<"你要做几道计算题?最多100道";
    cin>>n; 
    if (n<1 || n>100){
        cout<<"题目数错误,请重新输入"<<endl;
        cout<<"按任意键继续"<<endl; 
        cin>>l;
        js();
    } 
    for (i=1;i<=n;i++){
        c=rand()%3;
        if (c<2){
            a=rand()%1000;
            b=rand()%1000;
            if (c==0) cout<<a<<"+"<<b<<"=?"<<endl;
            else cout<<a<<"-"<<b<<"=?"<<endl;
            cin>>ans;
            if (c==0){
                if (ans==a+b) {
                    cout<<"正确!"<<endl;
                    q++;
                }
                else cout<<"错误!"<<endl;
            } 
            else {
                if (ans==a-b) {
                    cout<<"正确!"<<endl;
                    q++;
                }
                else cout<<"错误!"<<endl;
            }
        }
        else{
            a=rand()%10+1;
            b=rand()%99+1;
            if (c==2) cout<<a<<"*"<<b<<"=?"<<endl;
            else cout<<a*b<<"/"<<a<<"=?"<<endl;
            cin>>ans;
            if (c==2){
                if (ans==a*b) {
                    cout<<"正确!"<<endl;
                    q++;
                }
                else cout<<"错误!"<<endl;
            } 
            else {
                if (ans==b) {
                    cout<<"正确!"<<endl;
                    q++;
                }
                else cout<<"错误!"<<endl;
            }
        }
    }
    cout<<"你做对了"<<q<<"道题,获得"<<q*10<<"元"<<endl;
    n+=q*5; 
    save();
    pause();
}   
void get_money() {
    while (1) {
        save();
        cls();
        tt();
        cout << "你要干什么?\n";
        cout << "1.走迷宫 2.赌博 3.[简单]的赚钱 4.工作 5.返回上一页\n";
        char c = getch();
        if (c == '1') {
            save();
            cls();
            tt();
            char c = '0';
            cout << "\n";
            zoumigong(c);
        } else if (c == '2') {
            cls();
            tt();
            cout << "规则:现下赌注不少于5元,选择加倍(最少加1倍,最多3倍),\n";
            cout << "赌赢了获得倍数*赌注,赌输了扣除倍数*赌注\n";
            pause();
            cls();
            tt();
            cout << "请下你的赌注:\n";
            int x, y, z, ds;
            cin >> x;
            cout << "\n请输入加倍倍数:\n";
            cin >> y;
            cls();
            tt();
            cout << "赌局开始!\n";
            cls();
            tt();
            cout << "请选择你赌的数是(奇数为1/偶数为0):\n";
            cin >> z;
            cout << "\n开始摇数!\n";
            Sleep(750);
            cls();
            tt();
            ds = rand() * time(0) % 5 + 1;
            cout << "数为:" << ds << "\n";
            if (ds % 2 == z) {
                n += x * y;
                save();
                Sleep(1000);
                cout << "你赌对了!获得奖励" << x * y << "元!\n";
                pause();
            } else {
                n -= x * y;
                if (n < 0.00) n = 0.00;
                Sleep(1000);
                cout << "你赌错了!扣除钱币" << x * y << "元!\n";
                pause();
            }
        } else if (c == '3') {
            cout << "输入算式的答案!\n";
            cout << "如果正确,获得7元奖励!\n";
            pause();
            cls();
            int x = ((rand() * rand() * time(0) % 130) + 130) % 130 + 1;
            int y = x * (rand() * time(0) % 10 + 1);
            cout << y << " / " << x << " = ?\n";
            int ok = 0;
            int m;
            cin >> m;
            if (m == y / x) ok = 1;
            cls();
            if (ok) {
                n += 7;
                save();
                cout << "输入正确,获得7元奖励!\n";
            } else cout << "你输错了--TOT\n";
            pause();
            cls();
        } else if (c == '4') {
            cls();
            tt();
            cout << "你要怎么赚钱?1.打字母 2.数学题 3.返回上一页\n";
            c = getch();
            if (c == '1') dz();
            else if (c == '2') js();
            else if (c == '3') continue;
        } else if (c == '5') return ;
    }
}
void my_card() {
    while (1) {
        cls();
        save();
        tt();
        cout << "你要查看什么?\n";
        cout << "1.卡片 2.盒数 3.包数 4.返回上一页\n";
        char c = getch();
        if (c == '4') break;
        if (c == '1') {
            while (1) {
                cls();
                tt();
                cout << "你要查看哪个星级的卡片?按0返回上一页\n";
                c = getch();
                if (c == '0') break;
                if (c == '1') {
                    while (1) {
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 1; i <= 21; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
                if (c == '2') {
                    while (1) {
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 22; i <= 46; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
                if (c == '3') {
                    while (1) {
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 47; i <= 81; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
                if (c == '4') {
                    while (1) {
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 82; i <= 103; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        //82~125
                        cout << "请按任意键观看下一页...\n";
                        getch();
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 104; i <= 125; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
                if (c == '5') {
                    while (1) {
                        cls();
                        tt();
                        //126~171
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 126; i <= 148; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        cout << "请按任意键观看下一页...\n";
                        getch();
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 149; i <= 171; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
                if (c == '6') {
                    while (1) {
                        cls();
                        tt();
                        cout << "关卡名称    R   SR  SSR  UR  HR  ZR  LR  CR  GP  SHR\n";
                        for (int i = 172; i <= 179; i++) {
                            cout << a[i].name;
                            cout << setw(3) << a[i].lv1 << " ";
                            cout << setw(3) << a[i].lv2 << " ";
                            cout << setw(3) << a[i].lv3 << "  ";
                            cout << setw(3) << a[i].lv4 << " ";
                            cout << setw(3) << a[i].lv5 << " ";
                            cout << setw(3) << a[i].lv6 << " ";
                            cout << setw(3) << a[i].lv7 << " ";
                            cout << setw(3) << a[i].lv8 << " ";
                            cout << setw(3) << a[i].lv9 << " ";
                            cout << setw(3) << a[i].lv10 << "\n";
                        }
                        pause();
                        break;
                    }
                }
            }
        } else if (c == '2') {
            cls();
            tt();
            cout << "萌新盒:" << h1 << "盒\n";
            cout << "重生盒:" << h2 << "盒\n";
            cout << "经典盒:" << h3 << "盒\n";
            cout << "传奇盒:" << h4 << "盒\n";
            cout << "荣耀盒:" << h5 << "盒\n";
            cout << "生日快乐盒:" << z1 << "盒\n";
            cout << "四周年礼盒:" << z2 << "盒\n";
            cout << "六年的回忆:" << z3 << "盒\n";
            cout << "七年之梦盒:" << z4 << "盒\n";
            cout << "电·爱之盒:" << z5 << "盒\n";
            cout << "涅槃·重生:" << z6 << "盒\n";
            cout << "Time-Mory盒:" << z7 << "盒\n";
            pause();
        } else if (c == '3') {
            cls();
            tt();
            cout << "一元(萌新)包:" << b1 << "包\n";
            cout << "二元(重生)包:" << b2 << "包\n";
            cout << "三元(经典)包:" << b3 << "包\n";
            cout << "五元(传奇)包:" << b4 << "包\n";
            cout << "十元(荣耀)包:" << b5 << "包\n";
            cout << "三周年包:" << b6 << "包\n";
            cout << "四周年包:" << b7 << "包\n";
            cout << "六周年包:" << b8 << "包\n";
            cout << "七周年包:" << b9 << "包\n";
            cout << "十周年包:" << b10 << "包\n";
            pause();
        }
    }
}
int main() {
    //https://www.luogu.me/paste/89xusf17为原创,如果你是在其他的剪贴板复制的,请私信hxydz
    SetConsoleOutputCP(CP_UTF8);
    srand(time(0));
    char c;
    read();
    init();
    while (1) {
//      save();
        cls();
        tt();
        cout << "你现在有" << fixed << setprecision(2) << n << "元钱\n";
        cout << "1.去买卡 2.去抽卡 3.去赚钱 4.仓库 5.说明(必看)\n";
        c = getch();
        if (c == '1') buy_card();
        else if (c == '2') demolish_card();
        else if (c == '3') get_money();
        else if (c == '4') my_card();
        else if (c == '5') {
            cls();
            tt();
            cout << "1.为什么整盒的价格与同样包数的单包价格不一样?\n";
            cout << "因为整盒比出一张专属稀有卡,详见↓\n";
            cout << "萌新盒(一元包)必出1张GP(红卡),极小概率出绝版卡(最稀有)\n";
            cout << "重生盒(二元包)必出1张CR(金卡),很小概率出UR(磨砂卡)卡\n";
            cout << "经典盒(三元包)必出1张LR(彩卡),小概率出UR(磨砂卡)卡\n";
            cout << "传奇盒(五元包)概率出UR(磨砂卡)和HR(3D卡)卡,出SSR卡概率大\n";
            cout << "荣耀盒(十元包)必出1张SHR(特效3D卡),每包最开头\n";
            cout << "要么就是HR卡(3D卡)要么就是SHR卡(特效3D卡),并且概率出UR(磨砂卡)和ZR(黑卡)卡\n";
            cout << "单包价格越贵,出的卡就越好\n";
            cout << "R<SR<SSR<UR<HR<ZR<LR<CR<GP<SHR\n";
            cout << "2.为什么查看卡牌有时没对准?\n";
            cout << "特例Alone Remix,Fadad Remix,The Spectre,The Spectre Remix\n";
            cout << "因长度问题暂时只能这样,没办法了---\n";
            cout << "3.为什么上一个问题的特例有下划线?\n";
            cout << "因为没有下划线的话存档就会有BUG\n";
            pause();
        } else {
            cout << "what are you doing, young man/woman?\n";
            Sleep(1000);
        }
        save();
    }
    return 0;
}