问题标题: 石头剪刀布游戏最高可获得500豆

1
1
已解决
李宜和
李宜和
高级启示者
高级启示者
#include<bits/stdc++.h>
#include<windows.h>
#include<cstdlib>
#include<time.h>
using namespace std;
int main(){    
    srand((unsigned) time(NULL));
    long long a;
    MessageBox(NULL,"鑫汇工作室出品(李宜和)","鑫汇工作室",MB_OK);
    cout<<endl;
    cout<<"\t\t\t\t鑫汇";
    Sleep(3000);
    system("cls");
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<"\t\t\t\t加载中";
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    system("cls");
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    cout<<".";
    Sleep(300);
    system("cls");
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<endl;
    cout<<"\t\t\t\t完成!";
    system("cls");




    MessageBox(NULL,"1=石头,2=剪刀,3=布","规则",MB_OK);
while(1){
    cout<<"——————————————————————————————"<<endl;
    cout<<"|                                                          |"<<endl;
    cout<<"|   1.游戏(人机)    2.赌牌       3.看牌                    |"<<endl;
    cout<<"|                                                          |"<<endl;
    cout<<"|                                                          |"<<endl;
    cout<<"|                                                          |"<<endl;
    cout<<"——————————————————————————————"<<endl;




    int z;
    cin>>z;

    if(z==1){
        system("cls");
        long long re=0;
        while(1){
        long long n,m=0,o,h=0;
        o=rand()%3+1;
        cin>>n;
        if(n>3||n<1){
            cout<<"只可输入1,2,3"<<endl; 
            system("cls");
        }else if(n==1||n==2||n==3){
            m+=1;
            cout<<"您现在的得分是"<<re ; 
            Sleep(2000);
                system("cls");
            if(m==1){
                cout<<"你出的是";
                if(n==1){
                    cout<<"石头\t\t\t";
                }else if(n==2){
                    cout<<"剪刀\t\t\t";
                }else if(n==3){
                    cout<<"布\t\t\t";
                }
                cout<<"人机出的是";
                if(o==1){
                    cout<<"石头\t\t\t";
                }else if(o==2){
                    cout<<"剪刀\t\t\t";
                }else if(o==3){
                    cout<<"布\t\t\t";
                }
                Sleep(2000);
            }
            //____________________________________________ 
            if(o==n){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            平局                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"不加分。"<<endl; 
                cout<<"您现在的得分是"<<re<<endl; 
            }
//______________________________________________
            if(o==2&&n==3){
                system("cls");
                   cout<<"——————————————————————————————"<<endl;
                    cout<<"|                                                          |"<<endl;
                   cout<<"|                            你输了                        |"<<endl;
                    cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你输了哦!"<<endl;
                if(re!=0){
                    re--;
                }else if(re==0){
                    re++;
                    re--;
                }
                cout<<"您现在的得分是"<<re<<endl; 
            }
            if(o==3&&n==1){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            你输了                        |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你输了哦!"<<endl;
                if(re!=0){
                    re--;
                }else if(re==0){
                    re++;
                    re--;
                }
                cout<<"您现在的得分是"<<re<<endl; 
               }
            if(o==1&&n==2){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            你输了                        |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你输了哦!"<<endl;
                if(re!=0){
                    re--;
                }else if(re==0){
                    re++;
                    re--;
                }
                cout<<"您现在的得分是"<<re<<endl; 
            }
//_________________________________________________
            if(o==1&&n==3){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            你赢了                        |"<<endl;
                    cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你赢了哦!"<<endl;
                re+=1;
                cout<<"您现在的得分是"<<re<<endl; 
            }
            if(o==2&&n==1){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            你赢了                        |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你赢了哦!"<<endl;
                re+=1;
                cout<<"您现在的得分是"<<re<<endl; 
            }
            if(o==3&&n==2){
                system("cls");
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                            你赢了                        |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                cout<<"你赢了哦!"<<endl;
                re+=1;
                cout<<"您现在的得分是"<<re<<endl; 
            }
            if(re==7){
                system("cls");
                cout<<"恭喜闯关成功 ";
                Sleep(2000);
                break;
            }
        //_________________________________________________
            }    
        }
    }
    if(z==2){
        system("cls");
        cout<<"欢迎来到赌牌场,你可以猜人机出的什么牌,对了+2分,错了-1分,初始5分";
        Sleep(2000);
           system("cls");
           MessageBox(NULL,"1=石头,2=剪刀,3=布","规则",MB_OK);
           int qwe,tyu,op=5;
        while(1){
            system("cls");
            cout<<"你猜人机出"<<endl;
            cin>>qwe;
            tyu=rand()%3+1;
            cout<<"你猜的是";
               if(qwe==1){
                cout<<"石头\t\t\t";
            }else if(qwe==2){
                cout<<"剪刀\t\t\t";
            }else if(qwe==3){
                cout<<"布\t\t\t";
            }
               cout<<"人机出的是";
               Sleep(2000);
               if(tyu==1){
                   cout<<"石头\t\t\t"<<endl;
            }else if(tyu==2){
                cout<<"剪刀\t\t\t"<<endl;
            }else if(tyu==3){
                cout<<"布\t\t\t"<<endl;
            }
            if(qwe==tyu){
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                         你赢了                           |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                Sleep(2000);
                op+=2;
                cout<<"您现在的得分是"<<op<<endl; 
                Sleep(2000);
                system("cls");
                cout<<endl<<"你还想继续玩吗?1.想 2.不想";    
                int qq;
                cin>>qq;
                if(qq==1){
                    Sleep(2000);
                    system("cls");
                }else if(qq==2){
                    op=0;
                }
            }else{
                cout<<"——————————————————————————————"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                         你输了                           |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"|                                                          |"<<endl;
                cout<<"——————————————————————————————"<<endl;
                Sleep(2000);
                op--;
                cout<<"您现在的得分是"<<op<<endl; 
                Sleep(2000);
                system("cls");
                cout<<endl<<"你还想继续玩吗?1.想 2.不想";    
                int qqq;
                cin>>qqq;
                if(qqq==1){
                    Sleep(2000);
                    system("cls");
                }else if(qqq==2){
                    op=0;
                }
            }
            if(op>=15){
                system("cls");
                cout<<"恭喜闯关成功 ";
                Sleep(2000);
                cout<<endl<<"你还想继续玩吗?1.想 2.不想";
                int asdfghj;
                cin>>asdfghj;
                if(asdfghj==1){
                    Sleep(2000);
                    system("cls");
                    op==0;
                    system("cls");
                }else if(asdfghj==2){
                    break;
                    system("cls");
                }    
            }
            if(op<=0){
                cout<<"闯关失败。。。";    
                Sleep(2000);
                system("cls");
                break;            
            }
        }    
    }
    if(z==3){
        system("cls");
        cout<<"请记住顺序哦。"<<endl;
        Sleep(2000);
        int lopk,zxcv,vfrt,wsxd,nhyg,ftgb,jihg,asec,vtav,niwn,a1,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10;
        cout<<"请选择难度。1.萌新 2.老玩家  3.大神  4.灭世";
        cin>>a1;
        if(a1==1){
            lopk=rand()%9+1;
            zxcv=rand()%9+1;
            vfrt=rand()%9+1;
            wsxd=rand()%9+1;
            nhyg=rand()%9+1;
            ftgb=rand()%9+1;
            jihg=rand()%9+1;
            asec=rand()%9+1;
            vtav=rand()%9+1;
            niwn=rand()%9+1;
            system("cls");
            cout<<lopk;
            Sleep(2000);
            system("cls");
            cout<<zxcv;
            Sleep(2000);
            system("cls");
            cout<<vfrt;
            Sleep(2000);
            system("cls");
            cout<<wsxd;
            Sleep(2000);
            system("cls");
            cout<<nhyg;
            Sleep(2000);
            system("cls");
            cout<<ftgb;
            Sleep(2000);
            system("cls");
            cout<<jihg;
            Sleep(2000);
            system("cls");
            cout<<asec;
            Sleep(2000);
            system("cls");
            cout<<vtav;
            Sleep(2000);
            system("cls");
            cout<<niwn;
            Sleep(2000);
            system("cls");
            cout<<"下面开始复述吧!\n";
            cin>>b1>>b2>>b3>>b4>>b5>>b6>>b7>>b8>>b9>>b10; 
            if(b1==lopk&&b2==zxcv&&b3==vfrt&&b4==wsxd&&b5==nhyg&&b6==ftgb&&b7==jihg&&b8==asec&&b9==vtav&&b10==niwn){
                cout<<"\n闯关成功。!!";
                Sleep(2000);
                system("cls");
            }else{
                cout<<"\n闯关失败。。。";
                Sleep(2000);
                system("cls");
            }
        }else if(a1==2){
            int nm[100],mn[100],lyh=0;
            for(int i=1;i<=10;i++){
                nm[i]=rand()%109+1;
            }
            for(int i=1;i<=10;i++){
                system("cls");
                cout<<nm[i];
                Sleep(1500);
            }
            system("cls");
            cout<<"下面开始复述吧!\n";
            for(int i=1;i<=10;i++){
                cin>>mn[i];
                if(mn[i]==nm[i]){
                    lyh+=1;
                }
            }
            if(lyh==10){
                cout<<"\n闯关成功。!!";
                Sleep(2000);
                system("cls");
            }else{
                cout<<"\n闯关失败。。。";
                Sleep(2000);
                system("cls");
            }
        }else if(a1==3){
            int xy[100],yx[100],lyh1=0;
            for(int i=1;i<=10;i++){
                xy[i]=rand()%1009+1;
            }
            for(int i=1;i<=10;i++){
                system("cls");
                cout<<xy[i];
                Sleep(1000);
            }
            system("cls");
            cout<<"下面开始复述吧!\n";
            for(int i=1;i<=10;i++){
                cin>>yx[i];
                if(yx[i]==xy[i]){
                    lyh1+=1;
                }
            }
            if(lyh1==10){
                cout<<"\n闯关成功。!!";
                Sleep(2000);
                system("cls");
            }else{
                cout<<"\n闯关失败。。。";
                Sleep(2000);
                system("cls");
            }
        }else if(a1==4){
            int ab[100],ba[100],lyh2=0;
            for(int i=1;i<=10;i++){
                ab[i]=rand()%10009+1;
            }
            for(int i=1;i<=10;i++){
                system("cls");
                cout<<ab[i];
                Sleep(500);
            }
            system("cls");
            cout<<"下面开始复述吧!\n";
            for(int i=1;i<=10;i++){
                cin>>ba[i];
                if(ba[i]==ab[i]){
                    lyh2+=1;
                }
            }
            if(lyh2==10){
                cout<<"\n闯关成功。!!";
                Sleep(2000);
                system("cls");
            }else{
                cout<<"\n闯关失败。。。";
                Sleep(2000);
                system("cls");
            }
        }
    } 
}
    return 0;
}

很久之前**的,来怀念一下

完成剪刀石头布人机游戏第一个截图为证可获得250豆

完成猜牌游戏第一个截图为证可获得125豆

完成计数游戏灭世难度第一个截图为证可获得125豆

为了诚信请把C++文件和代码实质判断胜利条件(分别在209行、301行、458行)

例子:

必须将这些全部漏出(还有下方任务栏)否则无效


1
0
0
我要回答