• 个人简介

    //注:还未编完,每2周一次更新!
    //主编:赵海皓
    //试验人:陈余昂、黄海豚
    //未经本人(主编)允许,禁止篡改!!!
    #include<bits/stdc++.h>
    #include<windows.h>
    #include<conio.h>
    int a=1,sj[12]={0,25,30,50,100,200,500,1000,2000,5000,10000};//sj:升级钱财
    int dj=1,hchw=0,plantnum=0;
    int x;
    int shoper[2]={0,5};//shoper商品价格
    int bbalnum=0,bbnum[2001];
    int dj1_2=0,tdnum=0/*是否有田地*/;
    int plant[101],plantalnum[101],plantgrow[101];
    int plantinbbnum=0;
    int bb[2001];
    int plantname[1001];
    bool xrfl1=true;
    bool namejoker=false;
    int yuan=20;//钱数
    using namespace std;
    int beibao()
    {
    if(bbnum==0)
    {
    cout<<"背包为空!\n";
    Sleep(500);
    cout<<"按任意键返回...";
    int nnn=_getch();
    system("cls");
    }
    else
    {
    for(int i=1;i<=bbalnum;i++)
    {
    cout<<bb[i]<<"*"<<bbnum[i]<<"查看:s,使用:u\n";
    Sleep(500);
    }
    }
    }
    int tiandi()//我的田地
    {
    int f=0;
    system("cls");
    Sleep(500);
    cout<<"我的田地\n";
    Sleep(200);
    cout<<"已种植:";
    Sleep(500);
    if(plantnum==0)cout<<"无\n",Sleep(500);
    for(int i=1;i<=plantnum;i++)
    {
    if(plant[i]==1)cout<<"小麦种子*"<<plantalnum[i];
    cout<<"状态:";
    if(plantgrow[i]==1)cout<<"正在生长\n";
    if(plantgrow[i]==2)cout<<"已成熟(可收获,按"<<char(i+65)<<")\n";
    Sleep(500);
    }
    cout<<"种植植物:按x\n";
    int t=_getch();
    if(t=='x')
    {
    system("cls");
    if(bbalnum==0)
    {
    cout<<"背包为空!\n";
    Sleep(500);
    cout<<"去查看(按s)\n";
    Sleep(500);
    cout<<"返回(按q)\n";
    Sleep(500);
    int r=_getch();
    if(r=='s')beibao();
    cout<<"按任意键返回...";
    int s=_getch();
    system("cls");
    }
    else
    {
    cout<<"请选择要种植的植物(输入序号)\n";
    for(int i=1;i<=plantinbbnum;i++)
    {
    if(plantname[i]!=0)cout<<i<<".";
    else f++,cout<<i-f<<".";
    if(plantname[i]==1)cout<<"小麦种子\n";
    Sleep(500);
    }
    int t=_getch();
    if(plantname[t]==0)
    {
    cout<<"错误!\n";
    cout<<"按任意键返回...";
    int s=_getch();
    system("cls");
    }
    else
    {
    cout<<"种植成功!\n";
    plantname[t]=0;
    Sleep(500);
    cout<<"现在去看(输入s)\n";
    Sleep(200);
    }
    }
    }
    }
    int sh2j()//升2级大礼包
    {
    cout<<"选项1:15$\n";
    Sleep(1500);
    cout<<"选项2:一块田\n";
    Sleep(500);
    cout<<"请输入序号:";
    int t=_getch();
    if(t==1)
    {
    cout<<"选择成功!\n";
    yuan+=10;
    }
    if(t=='2')
    {
    tdnum=1;
    cout<<"选择成功!\n";
    Sleep(500);
    cout<<"现在去看(按t)\n";
    Sleep(500);
    cout<<"返回(按q)\n";
    Sleep(500);
    int t=_getch();
    if(t=='t')tiandi();
    }
    cout<<"按任意键返回...";
    int s=_getch();
    system("cls");
    }
    int shj()//升级
    {
    system("cls");
    Sleep(200);
    cout<<"是否用"<<sj[dj]<<"元升1级?\n";
    cout<<"是:Y,否:N\n";
    char t;
    t=_getch();
    if(t=='Y'||t=='y')
    {
    system("cls");
    Sleep(200);
    if(yuan>=sj[dj])
    {
    cout<<"升级成功!\n";
    yuan-=sj[dj];
    dj++;
    Sleep(500);
    cout<<"当前还剩"<<yuan<<"元\n";
    dj1_2=1;
    }
    else
    {
    cout<<"钱不够!\n";
    Sleep(200);
    cout<<"当前只有"<<yuan<<"元\n";
    }
    if(dj1_2==1)
    {
    system("pause");
    system("cls");
    cout<<"升2级大礼包\n";
    sh2j();
    }
    cout<<"按任意键返回...";
    int nnn=_getch();
    system("cls");
    }
    else
    {
    cout<<"按任意键返回...";
    int nnn=_getch();
    system("cls");
    }
    }
    int djck()//等级查看
    {
    char t;
    Sleep(200);
    system("cls");
    cout<<"当前等级:"<<dj<<"级"<<endl;
    Sleep(200);
    cout<<"货架:"<<sj[dj]/10<<"个空位\n";
    Sleep(200);
    cout<<"背包有"<<sj[dj]/5<<"个位置\n";
    Sleep(200);
    cout<<"还要"<<sj[dj]<<"元升级(按t升级)\n";
    Sleep(500);
    cout<<"返回(按q)\n";
    t=_getch();
    if(t=='t')shj();
    system("cls");
    Sleep(500);
    }
    
    int hj()
    {
    cout<<"当前没有货物在货架上。\n";
    Sleep(200);
    cout<<"上货:按s\n";
    Sleep(500);
    cout<<"打开背包:按o\n";
    Sleep(500);
    cout<<"返回:按q\n";
    char t=_getch();
    if(t=='s')
    {
    if(hchw==0)
    {
    cout<<"当前没有可上的货物!\n";
    Sleep(500);
    system("pause");
    system("cls");
    }
    else ;//当前未开发!
    }
    if(t=='o')beibao();
    if(t=='q')
    {
    cout<<"按任意键返回...";
    int nnn=_getch();
    system("cls");
    }
    }
    void tsh1()//提示1
    {
    system("pause");
    system("cls");
    cout<<"当钱数为0时,游戏结束!\n";
    Sleep(500);
    cout<<"你的初始资金为20元\n";
    Sleep(500);
    cout<<"加油!努力生存下去!\n";
    Sleep(2000);
    system("cls");
    }
    int shop()//公共商店
    {
    int r=rand()%3+1;
    if(r==1)
    {
    cout<<"商店未开门!!!\n";
    Sleep(2000);
    system("cls");
    }
    else
    {
    cout<<"商店\n";
    Sleep(200);
    cout<<"按商品的对应编号即可购买(返回:q)\n";
    Sleep(500);
    cout<<"1.小麦种子	5$/1个\n";
    Sleep(500);
    int k=_getch();
    if(k=='q')system("cls"),Sleep(500);
    if(k=='1')
    {
    cout<<"请输入购买数量(输好后请再输换行):";
    int v;
    cin>>v;
    if(v*shoper[1]<=yuan)
    {
    cout<<"购买成功!\n";
    plantinbbnum++;
    plantname[plantinbbnum]=1;
    yuan=yuan-v*shoper[1];
    cout<<"还剩"<<yuan<<"元\n";
    Sleep(500);
    cout<<"继续购买:按w\n";
    Sleep(500);
    cout<<"返回:按q\n";
    int g=_getch();
    }
    else
    {
    cout<<"钱不够!!!\n";
    Sleep(200);
    cout<<"当前只有"<<yuan<<"元";
    }
    }
    }
    }
    int myshop()//我的商店
    {
    char m;
    system("pause");
    system("cls");
    cout<<"我的商店:\n";
    Sleep(200);
    cout<<"等级(查看:输入a):"<<dj<<endl;
    Sleep(200);
    cout<<"升级(输入s):" <<sj[a]<<endl;
    Sleep(1000);
    cout<<"货架(查看:输入b)"<<endl;
    Sleep(200);
    cout<<"我的背包(查看:输入c)"<<endl;
    Sleep(500);
    cout<<"返回(输入q)\n"<<endl;
    Sleep(200);
    cout<<"请输入:";
    m=_getch();
    if(m=='a')djck();//ok
    if(m=='b')hj();//ok
    if(m=='s')shj();//ok
    if(m=='c')beibao();//ok
    if(m=='q')system("cls"),Sleep(200);
    }
    int xr1()//新人福利
    {
    system("cls");
    cout<<"新人福利:10$(领取:s)";
    if(xrfl1==false)cout<<"(已领取)";
    Sleep(500);
    cout<<"\n";
    cout<<"\n按'q'继续,按's'领取...\n";
    int t=_getch();
    if(t=='s'&&xrfl1==true)
    {
    system("pause");
    system("cls");
    cout<<"领取成功!\n";
    yuan+=10;
    xrfl1=false;
    Sleep(200);
    cout<<"按任意键返回...";
    int k=_getch();
    }
    else if(xrfl1==false)
    {
    cout<<"该券已领取!!!\n";
    cout<<"请等待10秒...(请勿按任意键!!!)\n";
    Sleep(10000);
    cout<<"受着!!!\n";
    Sleep(500);
    namejoker=true;
    cout<<"喜提新名:joker\n";
    Sleep(500);
    cout<<"按任意键返回...";
    int k=_getch();
    }
    system("cls");
    }
    int rw1()//每日任务
    {
    system("cls");
    Sleep(200);
    cout<<"每日任务:\n";
    Sleep(500);
    cout<<"暂无任务...\n";
    Sleep(500);
    cout<<"按任意键返回...";
    int s=_getch();
    system("cls");
    }
    int main()//主函数
    {
    system("color 6a");
    char t;
    while(true)
    {
    if(namejoker==true)cout<<"玩家名:joker\n",Sleep(1000);
    cout<<"$:"<<yuan<<"元"<<"     "<<"等级:"<<dj<<endl;
    Sleep(500);
    cout<<"提示:t\n商店:a\n自己的店:b\n新人福利:x\n每日任务:y\n";
    if(tdnum==1)cout<<"我的田地:c";
    t=_getch();
    if(t=='t')tsh1();//ok
    if(t=='a')shop();//ok
    if(t=='b')myshop();//ok
    if(t=='x')xr1();//ok
    if(t=='y')rw1();//ok
    if(t=='c'&&tdnum==1)tiandi();
    system("cls");
    }
    }
    
  • 最近活动

    This person is lazy and didn't join any contests or homework.
  • 最近编写的题解