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

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)
#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=20,MIN=1,a,hp;
bool flag=0,flag1=0;
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\t\t\t\t\t"; 
    system("pause");
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    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";
    Sleep(2000);
    system("cls");
    cout<<"\t正在载入游戏"; 
    for(int i=1;i<=6;i++){
    	Sleep(500);
    	cout<<".";	
	}
	
    Sleep(1000);
    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;
					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<<"( ?д?)つBye";
					flag=1;
					return false;	
				} 
				if(flag==1){
					system("cls");
					cout<<"( ?д?)つBye"; 
					break;
				}
			}	
		}
		if(flag==1){
			break;
		}
	}
    return 0;
}

 

李奕歌在2021-04-05 20:06:32追加了内容
#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
王文博
王文博
缔造者之神
缔造者之神

这个需要用高精度


    cin>>n;
    s1="1";
    s2="2";
    for(int j=2;j<n;j++)
    {
        memset(a,0,sizeof(a));
        memset(b,0,sizeof(b));
        a[0]=s1.size();
        b[0]=s2.size();
        for(int i=1;i<=a[0];i++)
        {
            a[i]=s1[a[0]-i]-'0';
        }
        for(int i=1;i<=b[0];i++)
        {
            b[i]=s2[b[0]-i]-'0';
        }
        sum=max(a[0],b[0]);
        for(int i=1;i<=sum;i++)
        {
            a[i]+=b[i];
            a[i+1]+=a[i]/10;
            a[i]%=10;
        }
        sum++;
        while((a[sum]==0)&&(sum>1))
        {
            sum--;
        }
        s=0;
        for(int i=sum;i>=1;i--)
        {
            x[s]=a[i]+'0';
            s++;
        }
        s1=s2;
        s2=x;
    }

 

我要回答