问题标题: 剪刀石头布(2.0)

0
0
已解决
李宜和
李宜和
高级启示者
高级启示者

不可能通关的人机模式

谁通过了截屏给30豆

#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);
    cout<<"——————————————————————————————"<<endl;
    cout<<"|                                                          |"<<endl;
    cout<<"|   1.游戏(人机)                     2.(手动)            |"<<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==5){
                system("cls");
                cout<<"恭喜闯关成功 ";
                break;
            }
        //_________________________________________________
            }    
        }
    }
        

    if(z==2){
        system("cls");
        cout<<"输入一个数,按Enter,让另外一个人输入一个数,按Enter。"<<endl;
        cout<<"左边是先输入的,右边是后输入的";
        Sleep(2000);
        system("cls"); 
        while(1){
        long long n,m=0,o,f,g;
        cin>>n;
        system("cls");
        cin>>o;
        system("cls");
//____________________________________________ 
        if(o==n){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                            平局                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
//______________________________________________
        if(o==2&&n==3){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|           你输了         你赢了                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
        if(o==3&&n==1){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|            你输了         你赢了                         |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
        if(o==1&&n==2){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|          你输了               你赢了                     |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
//_________________________________________________
        if(o==1&&n==3){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|           你赢了                你输了                   |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
        if(o==2&&n==1){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|          你赢了                   你输了                 |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
        if(o==3&&n==2){
            system("cls");
            cout<<"——————————————————————————————"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|          你赢了                  你输了                  |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"|                                                          |"<<endl;
            cout<<"——————————————————————————————"<<endl;
        }
        //_________________________________________________
        }
    }
    return 0;
}


0
0
0
曹灿阳
曹灿阳
初级天翼
初级天翼

我看了,你这就是坑人的代码!

我要回答