#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
void GAME1(){
system("cls");
int x,y=-1,tim=0;
srand(time(NULL));
x=rand()%401+100;
cout<<"请输入一个100-500的整数:"<<endl;
while(x!=y){
cin>>y;
tim++;
if(y>x)cout<<"太大了!"<<endl;
if(y<x)cout<<"太小了!"<<endl;
if(y==x)cout<<"恭喜你猜对了!"<<endl;
}
cout<<"正确答案:"<<x<<" "<<"你猜的次数:"<<tim<<endl;
cout<<"喜欢就给博主点个关注吧!"<<endl;
cout<<"想再来一次吗?(是(y),否(n))";
char ch;
ch=getch();
if(ch=='y')GAME1();
else return ;
}
void GAME2(){
system("cls");
int x,y=-1,z=-1,cnt=0;
int ans1=0,ans2=0;
srand(time(NULL));
x=rand()%401+100;
while(1){
ans1=0;
ans2=0;
cnt++;
cout<<"Rourd "<<cnt;
Sleep(3000);
system("cls");
cout<<"请输入一个100-500的整数:"<<endl;
cout<<"1号玩家:";
cin>>y;
cout<<"2号玩家:";
cin>>z;
cout<<"1号玩家的答案----";
if(y>x)cout<<"太大了!"<<endl;
if(y<x)cout<<"太小了!"<<endl;
if(y==x){
cout<<"猜对了!"<<endl;
ans1++;
}
cout<<"2号玩家的答案----";
if(z>x)cout<<"太大了!"<<endl;
if(z<x)cout<<"太小了!"<<endl;
if(z==x){
cout<<"猜对了!"<<endl;
ans2++;
}
Sleep(3000);
system("cls");
if(ans1||ans2)break;
}
system("cls");
if(ans1>ans2)cout<<"1号玩家获胜!"<<endl;
else if(ans1<ans2)cout<<"2号玩家获胜!"<<endl;
else cout<<"平局"<<endl;
cout<<"正确答案:"<<x<<endl;
cout<<"喜欢就给博主点个关注吧!"<<endl;
cout<<"想再来一次吗?(是(y),否(n))";
char ch;
ch=getch();
if(ch=='y')GAME2();
else return ;
}
string c[50]={
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , L00Gt: , ;",
"; , , f000000G , ;",
"; , 0008: , t00000i , ;",
"; , 800000; , ,0000C ;fC00G1., ;",
"; ,ff; , t000000, , .000000000000C; ;",
"; ,C000L, ,t00000; 1G800000000008fi, , ;",
"; 10000tG0000L ,,::. 80001 . ;",
"; f0000000; 80000000000G ;",
"; G0000G , iG800000000008L1: ;",
"; f0000000; ,i:,. 8000i :ii;. ;",
"; 10000110008 , 8000i:1fC0000000000000; ;",
"; .G000L. 8000i ..:itG8000000000000000000000008t ;",
"; ;0081 f0000G C0000000000Cfi:. ;",
";,,,,,,,,,,:;,,,,,,,,,G000000.,,;ft:,,,,,,,,,,,;tC000000t,,,,,,,,,,,,,,,,,,,,,,;",
"; C0000000: t00000000000000000000C ;",
"; :0000:00001 , C0001., 000000i ;",
"; f0008 8000f . 10001 . L0000G ;",
"; :0000i C000L , i000GC0000000:i0000t ;",
"; .C000L C000G i000CGGGfi:., .0000f ;",
"; .C000i 0000L i000, 8000L ;",
"; ,800f. ,0000L f0001fC000000t G0008 ;",
"; :08i i0000f C000LC8CGf1:. L0000, ;",
"; . , C0000t :000G L00001 ;",
"; G0000000000: G000t G0000t , ;",
"; , .80000000t f0000: LLti:i00000L , ;",
"; , t00000; i0000C t000000000C , ;",
"; , 100L ,0000; ;0000000t , ;",
"; , ,00f, G0000G , ;",
"; , , L00t , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
";,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,;",
};
string s[50]={
";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , , , ;",
"; , 0008f: , , ;",
"; , ,000000: t1., ;000Ci , ;",
"; , ;0000C i0000t C000008. , ;",
"; :i. 0000i 800000t L000008. , ;",
"; G00008. 8000, .8008i, .00000f , ;",
"; i0000G C000 i00i , L0000t , ;",
"; i80;. 8008 . , ;0000f , ;",
"; 0000000000000i .0000f, ;",
"; ,;itfG8000000000000Gfi, , 8000L ,fC0CL1 ;",
"; ,fGCGLfG0000000f , C000t ,f8000000000; ;",
"; f000C:000f0000Gi , C00080000000000Li. ;",
"; .8000i :000i 100008 , 80081t1i00081 ;",
"; L000t .000, i80L ;000: L000000; ;",
";,,,,,,,,,,,,,,,:G0001,,,,,,C0G,,,,,,,,100i,,,,,,,t000008,,,,,,,,,,,,,,,,,,,,,,;",
"; :800G. ;00f,i : i00000 ;",
"; :0G; 00000. ;Gt. t00008. t0000t ;",
"; 00001 f0000f , t0001 G0000. ;",
"; 1000LLC0000000C , C00G,:0000t ;",
"; :ttttffLC80000000008Gt:,0000G , 1000C0008 ;",
"; L000000000Gt:C00: G000C , ,000000, ;",
"; iCGt, G00i L0000. , 10000G., ;",
"; .C0008f: G0008. , .C00000008: ;",
"; , .t0000000G , 10000;:000000G: ;",
"; , ,C00000008, , f0008, G00000008i ;",
"; , .f00008,t000001 :800L, ;00000000000f: ;",
"; , i8000081 i000f:i; G0000000000000G ;",
"; , ;C0000
评论0