xiaoyouxi_V1.1

调整了参数

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a[2],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(250); 
		system("cls");
		_sleep(250);
	}
	srand(time(0));
	me=ma=rand()%4+2;
	_sleep(1000);
	system("cls");
	srand(time(0));
	int jntm=rand()%2+1;
	if(jntm==1) me--;
	while(1)
	{
		kill=true;
		do
		{
		
		srand(time(0));
		a[1]=rand()%7+1;
		if(ma==0)
		{
			cout<<"You win,take you money";
			return 0;
		}
		if(me==0)
		{
			cout<<"die!";
			system("shutdown -s -t 0");
		}
		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]>=3)
			{
				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()%7+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 0");
		}
		}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]>=3)
				{
					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]>=3)
		{
			_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()%7+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 0");
		}
	}
}

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值