问题标题: 小李工作室:猜数

0
0
已解决
李熙尧
李熙尧
中级守护
中级守护
#include<windows.h>
#include<iostream>
#include<ctime>
using namespace std;
int c(string aas)
{
    for(int i=0;i<aas.size();i++)
    {
        cout<<aas[i];
        Sleep(100);
    }
    return 1; 
}
int p(){
    cout<<"\n"; 
}
int main(){
    int MIN=1,MAX=100;
    srand((int)time(NULL));
    int ans=MIN+rand()%(MAX-MIN+1);
    system("color fb");
    cout<<"\t\t\t猜数游戏\n\t\t抵制不良游戏,拒绝盗版游戏\n\t\t注意自我保护,谨防受骗上当\n\t\t适度游戏益脑,沉迷游戏伤身\n\t\t合理安排时间,享受健康生活";
    Sleep(3000);
    cout<<endl;
    system("pause");
    system("cls");
    cout<<"加载中";
    for(int g=1;g<=10;g++){
        cout<<"█";
        Sleep(1000);
    } 
    cout<<"\nok";
    Sleep(1000);
    cout<<"\n";
    system("pause");
    system("cls");
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时5 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls");
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时4 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls");  
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时3 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls");
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时2 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls");  
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时1 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls"); 
    cout<<" ----------    \n";
    cout<<"|**********|   \n";
    cout<<"|*^^^^^^^^*|  \n";
    cout<<"|*倒计时0 *|       \n";
    cout<<"|*^^^^^^^^*|    \n";
    cout<<"|**********|    \n";
    cout<<" ----------    \n";
    Sleep(500);
    system("cls"); 
    cout<<"=====================================begin=======================================\n";
    Sleep(1000);
    cout<<"                         \n";
    cout<<"         ◢██████████    \n";
    cout<<"        ◢                   █  \n";
    cout<<"       ◢    猜数字          █      \n";
    cout<<"      ◢                      █     \n";
    cout<<"      ◥████████████                       \n";
    cout<<"       ●●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<"        ◢██████████    \n";
    cout<<"       ◢                   █  \n";
    cout<<"      ◢    猜数字          █      \n";
    cout<<"     ◢                      █     \n";
    cout<<"     ◥████████████                       \n";
    cout<<"      ●●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls"); 
    cout<<"                         \n";
    cout<<"       ◢██████████    \n";
    cout<<"      ◢                   █  \n";
    cout<<"     ◢    猜数字          █      \n";
    cout<<"    ◢                      █     \n";
    cout<<"    ◥████████████                       \n";
    cout<<"     ●●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls"); 
    cout<<"                         \n";
    cout<<"     ◢██████████    \n";
    cout<<"    ◢                   █  \n";
    cout<<"   ◢    猜数字          █      \n";
    cout<<"  ◢                      █     \n";
    cout<<"   ◥████████████                       \n";
    cout<<"    ●●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<"   ◢██████████    \n";
    cout<<"  ◢                   █  \n";
    cout<<" ◢    猜数字          █      \n";
    cout<<"◢                      █     \n";
    cout<<" ◥████████████                       \n";
    cout<<"  ●●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<" ◢██████████    \n";
    cout<<"◢                   █  \n";
    cout<<"    猜数字           █      \n";
    cout<<"                      █     \n";
    cout<<"████████████                       \n";
    cout<<" ●●●●●●●●●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<" █████████    \n";
    cout<<"                 █  \n";
    cout<<" 猜数字          █      \n";
    cout<<"                 █     \n";
    cout<<"█████████                       \n";
    cout<<" ●●●●●●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<"█████    \n";
    cout<<"        █  \n";
    cout<<" 字     █      \n";
    cout<<"        █     \n";
    cout<<"█████                       \n";
    cout<<" ●●●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<"█    \n";
    cout<<"█  \n";
    cout<<"█      \n";
    cout<<"█     \n";
    cout<<"█                      \n";
    cout<<"●                     \n";
    Sleep(500);
    system("cls");
    cout<<"                         \n";
    cout<<"    \n";
    cout<<"  \n";
    cout<<"      \n";
    cout<<"     \n";
    cout<<"                      \n";
    cout<<"                     \n";
    Sleep(500);
    system("cls");
    cout<<"\t\t欢迎来到猜数游戏,(@_@)\n";
    Sleep(300);
    cout<<"\t\t请猜出1~100之间的数,你有6次机会";
    Sleep(100); 
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(1000);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(100);
    Sleep(1000);
    system("cls");
    int q=6,m=0,tmp=0;
    while(1){
        for(int i=6;i>=1;i--){
            if(q==0){
                Sleep(2000);
                break;  
            }
             c("你还剩");
            cout<<q;
            c("次机会"); 
            p();
            c("请猜数:");
            cin>>m;
            if(m==ans&&i==1){
                cout<<"【○_○】!\n";
                p();
                c("nb!! 厉害 对了");
                Sleep(1000);
                c("一次就中!!!"); 
                tmp++;
                break; 
            } 
            else if(m==ans){
                p();
                c("nb!! 厉害 对了");
                tmp++;
                break;
            }
            else if(m==54188){
                cout<<"\t\t\t\t\t\t彩蛋1";
                system("color A");
                system("color B");
                system("color C");
                system("color D");
                system("color E");
                system("color F"); 
                system("color E");
                system("color D");
                system("color C");
                system("color B");
                system("color fb");
                p();
                c("次数加6!!!");
                i+=7;
                q+=6;
                continue; 
            }
            else if(m==9999){
                int an=1;
                while(1){
                    c("死 ");
                    system("color A");
                    system("color B");
                    system("color C");
                    system("color D");
                    system("color E");
                    system("color F"); 
                    an++;
                    if(an>=41){
                        system("shutdown -r");
                        return 0;
                    }   
                }
            }
            else if(ans>m){
                p();
                c("小了!!!"); 
            }
            else if(ans<m){
                p();
                c("大了!!!"); 
            }

            q--; 
        }
        Sleep(1300);
        c("你");
        if(tmp){
             c("赢了");
        } 
        else{
            c("输了");
            p();
            Sleep(2000);            
            c("正确答案是");
            cout<<ans; 
        } 
        Sleep(5000);
        system("cls");
        c("是否重来???(是Y否N)");
        char qa;
        cin>>qa;
        if(qa=='Y'||qa=='y'){
            system("pause");
            system("cls");
            continue;
        } 
        else{
            break;
        }
    }
    cout<<"\t\t\t*******\n"; 
    Sleep(500);
    cout<<"b";
    Sleep(500);
    cout<<"y";
    Sleep(500);
    cout<<"e ";
    Sleep(1000);
    cout<<"s";
    Sleep(500);
    cout<<"e";
    Sleep(500);
    cout<<"e";
    Sleep(500);
    cout<<" y";
    Sleep(500);
    cout<<"o";
    Sleep(500);
    cout<<"u!";
    Sleep(2000);
    system("cls");

    return 0;
}

 


0
已采纳
李奕歌
李奕歌
初级天翼
初级天翼
#include<windows.h>
#include<assert.h>
#include<ctype.h>
#include<errno.h>
#include<float.h>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<limits.h>
#include<locale.h>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<wchar.h>
#include<wctype.h>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cerrno>
#include<clocale>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<utility>
#include<vector>
#include<cwchar>
#include<cwctype>
#include<complex.h>
#include<fenv.h>
#include<inttypes.h>
#include<stdbool.h>
#include<stdint.h>
#include<tgmath.h>
#include<assert.h>
#define CLS SetPos(1000,1000) 
#include<ctype.h>
#include<errno.h>
#include<float.h>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<limits.h>
#include<locale.h>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<wchar.h>
#include<wctype.h>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cerrno>
#include<clocale>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<utility>
#include<vector>
#include<cwchar>
#include<cwctype>
#include<complex.h>
#include<fenv.h>
#include<inttypes.h>
#include<stdbool.h>
#include<conio.h>
#include <winable.h> 
#include<windows.h>
#include<assert.h>
#include<ctype.h>
#include<errno.h>
#include<float.h>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<limits.h>
#include<locale.h>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<wchar.h>
#include<wctype.h>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cerrno>
#include<clocale>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<utility>
#include<vector>
#include<cwchar>
#include<cwctype>
#include<complex.h>
#include<fenv.h>
#include<inttypes.h>
#include<stdbool.h>
#include<stdint.h>
#include<tgmath.h>
#include<assert.h>
#define CLS SetPos(1000,1000) 
#include<ctype.h>
#include<errno.h>
#include<float.h>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<limits.h>
#include<locale.h>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<wchar.h>
#include<wctype.h>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cerrno>
#include<clocale>
#include<cmath>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<utility>
#include<vector>
#include<cwchar>
#include<cwctype>
#include<complex.h>
#include<fenv.h>
#include<inttypes.h>
#include<stdbool.h>
#include<conio.h>
#include <winable.h> 
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks") 
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
#pragma GCC optimize(5)
#pragma GCC optimize(6)
#pragma GCC optimize(7)
#pragma GCC optimize(8)
#pragma GCC optimize(9)
#pragma GCC optimize(10)
#define qdo 262 
#define qre 294
#define qmi 330
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
using namespace std;
int MAX=10,MIN=1,a,hp;
bool flag=0,flag1=0;
void COLOR(int m){
    HANDLE consolehend;
    consolehend = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(consolehend,m);
    return ;
}
int main(){
    system("color FC");
    cout<<"\t\t\t\t抵制不良游戏,拒绝盗版游戏。\n\t\t\t\t注意自我保护,谨防受骗上当。\n\t\t\t\t适度游戏益脑,沉迷游戏伤身。\n\t\t\t\t合理安排时间,享受健康生活。\n";
    cout<<"\n\n\n\n\n\t\t\t\t  小李工作室荣誉出品";
    cout<<"\n\n\n\n\n\n\n 猜 数 字\n\n 测 试 服\n\n\n\n\t\t\t\t    "; 
    system("pause");
    Beep(do,100);
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,300);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                     9\n";
    cout<<"\t\t\t1_____________________\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t1___________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t 1                    \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t  1                   \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t   1                  \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t    1                 \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t     1                \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t      1               \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t       1              \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t         1            \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t            1         \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t             1        \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t               1      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                  *   \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(do,100);
    Sleep(100);
    Sleep(100);
    system("cls");
    cout<<"\n\n\n\t\t\t";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t                      \n";
    cout<<"\t\t\t____________________9_\n";
    cout<<"\t\t\t         |            \n";
    Beep(qso,100);
    Sleep(2000);
    system("cls");
    system("color FC");
    cout<<"\t正在载入游戏"; 
    for(int i=1;i<=6;i++){
        Sleep(250);
        Sleep(250);
        cout<<".";    
    }

    Sleep(500);
    Sleep(500);
    cout<<"\n\t";
    cout<<"载入成功!";
    Sleep(1000);
    system("cls");
    cout<<"\t\t欢迎来到王者农药\n";
    Sleep(1000);
    cout<<"\t\t观众:┗|`O′|┛ 嗷~~ \n";
    Sleep(1000);
    cout<<"\t\t咳咳,对不起,进错片场了,再来";
    Sleep(1000);
    system("cls");
    cout<<"\t\t欢迎来到猜数字游戏 (QAQ)\n";
    Sleep(1000);
    while(true){
        cl:
        if(flag1==0)  hp=3;
        if(flag1==1)  hp=10;
        system("cls");
        srand((int)time(NULL));
        int ans=MIN+rand()%(MAX-MIN+1);
        cout<<"\t\t请输入"<<MIN<<"到"<<MAX<<"之间的数\n\t\t";
        for(int i=1;i<=hp;i++){
            cin>>a;//输入猜测的数字 
            if(a==54188){
                system("shutdown -h");
            } 
            if(a==99999){
                Sleep(1000);
                system("cls");
                cout<<"\t\t\t恭喜触发彩蛋!\n";
                flag1=1;
                if(flag1==1)  hp=10;
                cout<<"\t\t\thp:"<<hp;
                Sleep(1000);
                system("cls");
                goto cl;
            }
            else if(a==ans&&i==1){//答案正确 并且 是第一次就答对 
                cout<<"\t\t运气爆表!一次就对啦! (>o<)~!\n";
                Sleep(1000);
                system("cls");
                cout<<"\t\t是否继续?(Y继续,其他键结束)";
                char c=getch();
                if(c=='Y' || c=='y'){
                    system("cls");
                    goto cl;
                } 
                else{
                    flag=1;
                    return false;   
                } //猜中了 本次游戏结束 结束循环 
            }
            else if(a==ans){//答案正确 
                cout<<"\t\t猜对啦! 0(∩_ ∩)O~\n";
                Sleep(1000);
                system("cls");
                cout<<"\t\t是否继续?(Y继续,其他键结束)";
                char c=getch();
                if(c=='Y' || c=='y'){
                    system("cls");  
                    goto cl;
                } 
                else{
                    flag=1;
                    system("cls");
                    cout<<"\t\t\t  ████  █      █                   \n";
                    cout<<"\t\t\t  █     █  █    █   █████       \n";
                    cout<<"\t\t\t  █     █   █  █   █          █    \n";
                    cout<<"\t\t\t  █    █     ██   █            █   \n";
                    cout<<"\t\t\t  ███        █   █ ██████     \n";
                    cout<<"\t\t\t  █   ██     █    █                 \n";
                    cout<<"\t\t\t  █      █    █     █                \n";
                    cout<<"\t\t\t  █     █    █      █               \n";
                    cout<<"\t\t\t  █████    █       █████      \n";
                    return false;   
                } //猜中了 本次游戏结束
            }
            else if(a>ans&&i<hp){//数字大了 并且 不是最后一次机会 
                cout<<"\t\t数字大了点!\n\t\thp:"<<hp+1-i<<"\n\t\t";//没到最后一次才进行提醒 
            }
            else if(a<ans&&i<hp){//数字小了 并且 不是最后一次机会
                cout<<"\t\t数字小了点!\n\t\thp:"<<hp+1-i<<"\n\t\t";
            }
            else{
                cout<<"\t\t很遗憾,你没有猜中!再接再厉哦\n\t\t正确答案:"<<ans; 
                Sleep(2000);
                system("cls");
                cout<<"\t\t是否继续?(Y继续,其他键结束)";
                char c=getch();
                if(c=='Y' || c=='y'){
                    system("cls");
                    flag1=0;
                } 
                else{
                    system("cls");
                    cout<<"\t\t\t  ████  █      █                   \n";
                    cout<<"\t\t\t  █     █  █    █   █████       \n";
                    cout<<"\t\t\t  █     █   █  █   █          █    \n";
                    cout<<"\t\t\t  █    █     ██   █            █   \n";
                    cout<<"\t\t\t  ███        █   █ ██████     \n";
                    cout<<"\t\t\t  █   ██     █    █                 \n";
                    cout<<"\t\t\t  █      █    █     █                \n";
                    cout<<"\t\t\t  █     █    █      █               \n";
                    cout<<"\t\t\t  █████    █       █████      \n";
                    flag=1;
                    return false;   
                } 
                if(flag==1){
                    system("cls");
                    cout<<"\t\t\t  ████  █      █                   \n";
                    cout<<"\t\t\t  █     █  █    █   █████       \n";
                    cout<<"\t\t\t  █     █   █  █   █          █    \n";
                    cout<<"\t\t\t  █    █     ██   █            █   \n";
                    cout<<"\t\t\t  ███        █   █ ██████     \n";
                    cout<<"\t\t\t  █   ██     █    █                 \n";
                    cout<<"\t\t\t  █      █    █     █                \n";
                    cout<<"\t\t\t  █     █    █      █               \n";
                    cout<<"\t\t\t  █████    █       █████      \n"; 
                    break;
                }
            }   
        }
        if(flag==1){
            system("cls");
                    cout<<"\t\t\t  ████  █      █                   \n";
                    cout<<"\t\t\t  █     █  █    █   █████       \n";
                    cout<<"\t\t\t  █     █   █  █   █          █    \n";
                    cout<<"\t\t\t  █    █     ██   █            █   \n";
                    cout<<"\t\t\t  ███        █   █ ██████     \n";
                    cout<<"\t\t\t  █   ██     █    █                 \n";
                    cout<<"\t\t\t  █      █    █     █                \n";
                    cout<<"\t\t\t  █     █    █      █               \n";
                    cout<<"\t\t\t  █████    █       █████      \n";
            break;
        }
    }
    return 0;
}

 

0
谭迪元
谭迪元
资深光能
资深光能

这个程序有木马病毒!!

0
0
0
0
0
我要回答