youdianlaji
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a[9],j,ma,me,t;
bool kill=true;
string name;
int main()
{
cout<<"Please sign the certificate of Life and death ..."<<endl;
cin>>name;
system("cls");
for(int i=1;i<=3;i++)
{
cout<<'I';
_sleep(200);
system("cls");
_sleep(200);
}
srand(time(0));
me=ma=rand()%4+2;
_sleep(1100);
system("cls");
while(1)
{
kill=true;
do
{
srand(time(0));
a[1]=rand()%2+1;
if(ma==0)
{
cout<<"You win,take you money";
return 0;
}
if(me==0)
{
cout<<"die!";
system("shutdown -s -t 1");
}
system("cls");
cout<<"master:"<<ma<<endl<<name<<':'<<me;
_sleep(1300);
system("cls");
cout<<"shoots?"<<endl;
cout<<"1.you "<<"2.master"<<endl;
cin>>j;
if(j==1)
{
if(a[1]==1)
{
system("cls");
_sleep(1000);
cout<<"You was shot!";
me--;
_sleep(1000);
system("cls");
if(me==1) cout<<"Next , be careful!";
_sleep(2000);
system("cls");
kill=false;
}
else
{
cout<<"no thing";
_sleep(1000);
system("cls");
srand(time(0));
a[1]=rand()%2+1;
}
}
else
{
if(a[1])
{
cout<<"He was shot!";
ma--;
_sleep(1000);
system("cls");
}
else
{
cout<<"no thing";
_sleep(1000);
system("cls");
}
kill=false;
}
if(ma==0)
{
cout<<"You win,take you money";
return 0;
}
if(me==0)
{
cout<<"die!";
system("shutdown -s -t 1");
}
}while(kill);
bool jump=true;
do
{
srand(time(0));
int jntm=rand()%6+1;
if(jntm>3)
{
cout<<"He shoots you ...";
_sleep(800);
system("cls");
if(a[1]==1)
{
system("cls");
_sleep(2000);
cout<<"You was shot!";
me--;
_sleep(1000);
system("cls");
}
else
{
_sleep(2000);
cout<<"no thing";
_sleep(1000);
system("cls");
}
jump=false;
}
else
{
cout<<"He shoots him ...";
_sleep(800);
system("cls");
if(a[1]==1)
{
_sleep(1000);
cout<<"He was shot!";
_sleep(1000);
system("cls");
ma--;
jump=false;
}
else
{
_sleep(2000);
cout<<"no thing";
_sleep(1000);
system("cls");
srand(time(0));
a[1]=rand()%2+1;
}
}
if(ma<=0) break;
if(me<=0) break;
}while(jump);
if(ma==0)
{
cout<<"You win,take you money";
return 0;
}
if(me==0)
{
cout<<"die!";
system("shutdown -s -t 1");
}
}
}
标签:cout,int,system,name,xiaoyouxi,include,cls
From: https://blog.csdn.net/BIGzhk/article/details/140893217