跳到正文

休闲·娱乐

帮yanziwei88改的代码

_Missile_约 58 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 58 分钟
获赞
1

版本

  1. v1当前
C++
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int jnn[19];
int cnt=1;
string name;
int money1=100;
int money2=0;
int a=0,b=0;
int c=0,d=0;
bool s=0;
int tl=10;
bool zhan(int x,int y){
	bool hb=1;
	int b1=b,cs=3+cnt/1000;
	while(1){
		if(y<=0)return 1;
		if(b1<=0)return 0;
		bool df=1;
		cout<<"你 攻击:"<<a<<"血量:"<<b1<<endl;
		cout<<"敌方 攻击:"<<x<<"血量:"<<y<<endl;
		cout<<"(1)攻击"<<endl;
		if(jnn[1]==1){
			cout<<"(2)横扫千军"<<endl;
		}
		if(jnn[2]==1){
			cout<<"(3)回血"<<endl;
		}
		if(jnn[3]==1){
			cout<<"(4)肘击"<<endl;
		}
		if(jnn[4]==1){
			cout<<"(5)寒冰尖刺"<<endl;
		}
		if(jnn[5]==1){
			cout<<"(6)激光炮"<<endl;
		}
		if(jnn[6]==1){
			cout<<"(7)打狗棒法"<<endl;
		}
		if(jnn[7]==1){
			cout<<"(8)火焰之力"<<endl;
		}
		if(jnn[8]==1){
			cout<<"(9)水之力"<<endl;
		}
		if(jnn[9]==1&&cs!=0){
			cout<<"(10)创世之力"<<endl;
		}
		int f;
		cin>>f;
		if(f==1){
			cout<<"你攻击了他 "<<a<<"滴血"<<endl;
			y-=a;
			hb=1;
			df=1;
		}
		if(f==2&&jnn[1]==1){
			cout<<"你用横扫千军攻击了他 "<<2*a<<"滴血"<<endl;
			hb=1;
			y-=a*2;
			df=1;
		}
		if(f==3&&jnn[2]==1){
			cout<<"你回了"<<cnt/2<<"滴血"<<endl;
			hb=1;
			b1+=b/2;
			df=1;
		}
		if(f==4&&jnn[3]==1){
			cout<<"你肘击了他 "<<a*1.5<<"滴血"<<endl;
			hb=1;
			y-=a*1.5;
			df=1;
		}
		if(f==5&&jnn[4]==1&&hb==1){
			cout<<"你攻击了他 "<<a*1.4<<"滴血"<<endl;
			cout<<"你冰冻了他"<<endl;
			y-=a*1.4;
			df=0;
			hb=0;
		}
		if(f==6&&jnn[5]==1){
			cout<<"你轰了他 "<<300<<"滴血"<<endl;
			y-=300;
			df=1;
			hb=1;
		}
		if(f==7&&jnn[6]==1){
			cout<<"你打了他 "<<a*0.9<<"滴血"<<endl;
			srand(time(0));
			int lj=rand()%3;
			y-=a*0.9;
			for(int l=1;l<=lj;l++){
				cout<<"你触发连击"<<endl;
				cout<<"你打了他 "<<a*0.9<<"滴血"<<endl;
				y-=a*0.9;
			}
			df=1;
			hb=1;
		}
		if(f==8&&jnn[7]==1){
			cout<<"你烧了他 "<<a*1.1+200<<"滴血"<<endl;
			y-=a*1.1+200;
			df=1;
			hb=1;
		}
		if(f==9&&jnn[8]==1){
			cout<<"你回了"<<cnt/3<<"滴血"<<endl;
			cout<<"你攻击了他 "<<a*0.8<<"滴血"<<endl;
			y-=a*0.8;
			hb=1;
			b1+=b/3;
			df=1;
		}
		if(f==10&&jnn[9]==1&&cs!=0){
			cout<<"你攻击了他 "<<a*3<<"滴血"<<endl;
			y-=a*3;
			df=1;
			hb=1;
			cs--;
		}
		if(df==1){
			srand(time(0));
			int x1=rand()%3;
			if(x1==1){
				cout<<"他开了大招你 -"<<x*2<<"滴血"<<endl;
			}else if(x1==2){
				cout<<"他用了技能你 -"<<x*1.4<<"滴血"<<endl;
			}else{
				cout<<"他攻击了你 -"<<x<<"滴血"<<endl;
			}
			b1-=x;
		}
	}
	return 1;
}
void shangdian(){
	system("cls");
	cout<<"(1)青龙偃月刀 1000金币或10钻石"<<endl;
	cout<<"(2)藤甲 200金币或2钻石"<<endl;
	cout<<"(3)城市升级 100金币或1钻石"<<endl;
	cout<<"(4)加命丹 300金币或3钻石"<<endl;
	cout<<"(5)宝刀 100金币或1钻石"<<endl;
	cout<<"(6)匕首 10金币"<<endl;
	cout<<"(7)小镇升级 20金币"<<endl;
	cout<<"(8)横扫千军 1000金币或10钻石"<<endl;
	cout<<"(9)回血 300金币或3钻石"<<endl;
	cout<<"(10)肘击 500金币或5钻石"<<endl;
	cout<<"(11)寒冰尖刺 700金币或7钻石"<<endl;
	cout<<"(12)激光炮 200金币或2钻石"<<endl;
	cout<<"(13)打狗棒法 400金币或4钻石"<<endl;
	int y;
	cin>>y;
	if(y==1)
	{
		if(money1<1000 && money2<10)
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			a+=150;
			if(money1>1000)
			{
				money1-=1000;
			}
			else
			{
				money2-=10;
			}
		}
	}
	if(y==2)
	{
		if(money1<200 && money2<2)
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			b+=30;
			if(money1>1000)
			{
				money1-=200;
			}
			else
			{
				money2-=2;
			}
		}
	}
	if(y==3)
	{
		if(money1<100 && money2<1)
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			d+=6;
			if(money1>100)
			{
				money1-=100;
			}
			else
			{
				money2-=1;
			}
		}
	}
	if(y==4)
	{
		if(money1<300 && money2<3)
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			c+=1;
			if(money1>300)
			{
				money1-=300;
			}
			else
			{
				money2-=3;
			}
		}
	}
	if(y==5)
	{
		if(money1<100 && money2<1)
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			a+=11;
			if(money1>100)
			{
				money1-=100;
			}
			else
			{
				money2-=1;
			}
		}
	}
	if(y==6)
	{
		if(money1<10 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			a+=1;
			if(money1>10)
			{
				money1-=10;
			}
		}
	}
	if(y==7)
	{
		if(money1<20 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			d+=1;
			if(money1>20)
			{
				money1-=20;
			}
		}
	}
	if(y==8)
	{
		if(money1<1000&&money2<10 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[1]=1;
			if(money1>1000)
			{
				money1-=1000;
			}else{
				money2-=10;
			}
		}
	}
	if(y==9)
	{
		if(money1<300&&money2<3 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[2]=1;
			if(money1>300)
			{
				money1-=300;
			}else{
				money2-=3;
			}
		}
	}
	if(y==10)
	{
		if(money1<500&&money2<5 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[3]=1;
			if(money1>500)
			{
				money1-=500;
			}else{
				money2-=5;
			}
		}
	}
	if(y==11)
	{
		if(money1<700&&money2<7 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[4]=1;
			if(money1>700)
			{
				money1-=700;
			}else{
				money2-=7;
			}
		}
	}
	if(y==12)
	{
		if(money1<200&&money2<2 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[5]=1;
			if(money1>200)
			{
				money1-=200;
			}else{
				money2-=2;
			}
		}
	}
	if(y==13)
	{
		if(money1<400&&money2<4 )
		{
			cout<<"钱不够"<<endl;
		}
		else
		{
			jnn[6]=1;
			if(money1>400)
			{
				money1-=400;
			}else{
				money2-=4;
			}
		}
	}
	return ;
}
void caipiao(){
	int f;
	cin>>f;
	if(f==1){
		money1-=10;
		srand(time(0));
		int nm=rand()%10;
		if(nm==0){
			cout<<"特等奖"<<endl;
			money1+=500;
		}
		if(nm==1){
			cout<<"一等奖"<<endl;
			money1+=200;
		}
		if(nm==2){
			cout<<"二等奖"<<endl;
			money1+=100;
		}
		if(nm==3){
			cout<<"三等奖"<<endl;
			money1+=50;
		}
		if(nm==4){
			cout<<"四等奖"<<endl;
			money1+=20;
		}
		if(nm==5){
			cout<<"五等奖"<<endl;
			money1+=10;
		}
		if(nm>=6){
			cout<<"谢谢惠顾"<<endl;
		}
	}
	if(f==2){
		money1-=20;
		srand(time(0));
		int nm=rand()%10;
		if(nm==0){
			cout<<"特等奖"<<endl;
			money1+=500*3;
		}
		if(nm==1){
			cout<<"一等奖"<<endl;
			money1+=200*3;
		}
		if(nm==2){
			cout<<"二等奖"<<endl;
			money1+=100*3;
		}
		if(nm==3){
			cout<<"三等奖"<<endl;
			money1+=50*3;
		}
		if(nm==4){
			cout<<"四等奖"<<endl;
			money1+=20*3;
		}
		if(nm==5){
			cout<<"五等奖"<<endl;
			money1+=10*3;
		}
		if(nm>=6){
			cout<<"谢谢惠顾"<<endl;
		}
	}
	if(f==3){
		money1-=10;
		srand(time(0));
		int nm=rand()%10;
		if(nm==0){
			cout<<"特等奖"<<endl;
			money1+=500*7;
		}
		if(nm==1){
			cout<<"一等奖"<<endl;
			money1+=200*7;
		}
		if(nm==2){
			cout<<"二等奖"<<endl;
			money1+=100*7;
		}
		if(nm==3){
			cout<<"三等奖"<<endl;
			money1+=50*7;
		}
		if(nm==4){
			cout<<"四等奖"<<endl;
			money1+=20*7;
		}
		if(nm==5){
			cout<<"五等奖"<<endl;
			money1+=10*7;
		}
		if(nm>=6){
			cout<<"谢谢惠顾"<<endl;
		}
	}
	if(f==4){
		money1-=10;
		srand(time(0));
		int nm=rand()%10;
		if(nm==0){
			cout<<"特等奖"<<endl;
			money1+=500*13;
		}
		if(nm==1){
			cout<<"一等奖"<<endl;
			money1+=200*13;
		}
		if(nm==2){
			cout<<"二等奖"<<endl;
			money1+=100*13;
		}
		if(nm==3){
			cout<<"三等奖"<<endl;
			money1+=50*13;
		}
		if(nm==4){
			cout<<"四等奖"<<endl;
			money1+=20*13;
		}
		if(nm==5){
			cout<<"五等奖"<<endl;
			money1+=10*13;
		}
		if(nm>=6){
			cout<<"谢谢惠顾"<<endl;
		}
	}
	Sleep(1500);
	system("cls");
	return ;
}
void denji(){
	if(cnt<=20){
		cout<<"兵"<<endl;
	}else if(cnt<=35){
		cout<<"士"<<endl;
	}else if(cnt<=50){
		cout<<"将"<<endl;
	}else if(cnt<=70){
		cout<<"王"<<endl;
	}else if(cnt<=90){
		cout<<"主"<<endl;
	}else if(cnt<=120){
		cout<<"皇"<<endl;
	}else if(cnt<=150){
		cout<<"尊"<<endl;
	}else if(cnt<=200){
		cout<<"帝"<<endl;
	}else if(cnt<=250){
		cout<<"练气"<<endl;
	}else if(cnt<=300){
		cout<<"巩基"<<endl;
	}else if(cnt<=400){
		cout<<"金丹"<<endl;
	}else if(cnt<=500){
		cout<<"元婴"<<endl;
	}else if(cnt<=600){
		cout<<"化神"<<endl;
	}else if(cnt<=800){
		cout<<"神"<<endl;
	}else if(cnt<=1000){
		cout<<"超神"<<endl;
	}else if(cnt<=1500){
		cout<<"真神"<<endl;
	}else if(cnt<=2000){
		cout<<"神王"<<endl;
	}else if(cnt<=2500){
		cout<<"小神尊"<<endl;
	}else if(cnt<=3000){
		cout<<"神尊"<<endl;
	}else if(cnt<=5000){
		cout<<"圣尊"<<endl;
	}else if(cnt<=6000){
		cout<<"半步至尊"<<endl;
	}else  if(cnt<=7500){
		cout<<"至尊"<<endl;
	}else if(cnt<=10000){
		cout<<"天尊"<<endl;
	}else if(cnt<=15000){
		cout<<"无敌强者"<<endl;
	}else if(cnt<=20000){
		cout<<"无敌强者 青铜3"<<endl;
	}else if(cnt<=25000){
		cout<<"无敌强者 青铜2"<<endl;
	}else if(cnt<=40000){
		cout<<"无敌强者 青铜1"<<endl;
	}else if(cnt<=55000){
		cout<<"无敌强者 白银3"<<endl;
	}else if(cnt<=70000){
		cout<<"无敌强者 白银2"<<endl;
	}else if(cnt<=85000){
		cout<<"无敌强者 白银1"<<endl;
	}else if(cnt<=100000){
		cout<<"无敌强者 黄金5"<<endl;
	}else if(cnt<=125000){
		cout<<"无敌强者 黄金4"<<endl;
	}else if(cnt<=150000){
		cout<<"无敌强者 黄金3"<<endl;
	}else if(cnt<=175000){
		cout<<"无敌强者 黄金2"<<endl;
	}else if(cnt<=200000){
		cout<<"无敌强者 黄金1"<<endl;
	}else if(cnt<=250000){
		cout<<"无敌强者 钻石5"<<endl;
	}else if(cnt<=300000){
		cout<<"无敌强者 钻石4"<<endl;
	}else if(cnt<=350000){
		cout<<"无敌强者 钻石3"<<endl;
	}else if(cnt<=400000){
		cout<<"无敌强者 钻石2"<<endl;
	}else if(cnt<=450000){
		cout<<"无敌强者 钻石1"<<endl;
	}else if(cnt<=500000){
		cout<<"无敌强者 星耀7"<<endl;
	}else if(cnt<=600000){
		cout<<"无敌强者 星耀6"<<endl;
	}else if(cnt<=700000){
		cout<<"无敌强者 星耀5"<<endl;
	}else if(cnt<=800000){
		cout<<"无敌强者 星耀4"<<endl;
	}else if(cnt<=900000){
		cout<<"无敌强者 星耀3"<<endl;
	}else if(cnt<=100000){
		cout<<"无敌强者 星耀2"<<endl;
	}else if(cnt<=200000){
		cout<<"无敌强者 星耀1"<<endl;
	}else {
		cout<<"你无敌了"<<endl;
	}
	return ;
}
void xiulian(){
	system("cls");
	if(cnt%10!=0)
	{
		a++;
		b+=5;
		tl+=1;
		cout<<"成功了!!"<<endl;
		cnt+=1;
	}
	else
	{
		if(d>=1)
		{
			d--;
			cnt+=1;
		}
	}
	return ;
}
void dagong(){
	tl--;
	for(int i=1;i<=100;i++){
		cout<<"打工中"<<endl;
	}
	srand(time(0));
	int f=rand()%10;
	if(f==3){
		srand(time(0));
		int zs=rand()%2;
		cout<<"你获得了"<<zs<<"颗钻石"<<endl;
		money2+=zs;
	}else if(f==2){
		cout<<"资本家太黑心了没给你金币"<<endl;
	}else if(f==1){
		cout<<"资本家太黑心了没给你金币"<<endl;
		cout<<"于是你打了他"<<endl;
		cout<<"金币-"<<10<<endl;
		money1-=10;
	}else{
		srand(time(0));
		int jb=rand()%10;
		cout<<"你获得了"<<jb<<"枚金币"<<endl;
		money1+=jb;
	}
	Sleep(1000);
	system("cls");
}
void yuwai(){
	system("cls");
	srand(time(0));
	int x=rand()%20;
	if(x==9){
		cout<<"骷髅战士:攻击2150,防御4160 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(2150,4160);
			if(l)
			{
				cout<<"你打赢了,获得125金币,25钻石"<<endl;
				money1+=125;
				money2+=25;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==10){
		cout<<"骷髅法师:攻击3150,防御3408 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(3150,3408);
			if(l)
			{
				cout<<"你打赢了,获得125金币,25钻石"<<endl;
				money1+=125;
				money2+=25;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==1){
		cout<<"神龙:攻击11500,防御24080 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(11500,24080);
			if(l)
			{
				cout<<"你打赢了,获得1000金币,100钻石"<<endl;
				money1+=1000;
				money2+=100;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==2){
		cout<<"神圣巨龙:攻击9500,防御18080 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(9500,18080);
			if(l)
			{
				cout<<"你打赢了,获得800金币,65钻石"<<endl;
				money1+=800;
				money2+=65;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==3){
		cout<<"龙:攻击7500,防御14080 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(7500,14080);
			if(l)
			{
				cout<<"你打赢了,获得485金币,55钻石"<<endl;
				money1+=485;
				money2+=55;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==13){
		cout<<"小龙:攻击5500,防御10080 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(5500,10080);
			if(l)
			{
				cout<<"你打赢了,获得325金币,36钻石"<<endl;
				money1+=325;
				money2+=36;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==8){
		cout<<"劫匪:攻击1150,防御1900 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(1150,1900);
			if(l)
			{
				cout<<"你打赢了,获得200金币"<<endl;
				money1+=200;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==5){
		cout<<"火神:攻击3150,防御7900 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(3150,7900);
			if(l)
			{
				cout<<"你打赢了,获得火焰之力"<<endl;
				jnn[7]=1;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==6){
		cout<<"水神:攻击1450,防御19000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(1450,19000);
			if(l)
			{
				cout<<"你打赢了,获得水之力"<<endl;
				jnn[8]=1;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==7){
		cout<<"him:攻击10000,防御80000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(10000,80000);
			if(l)
			{
				cout<<"你打赢了,获得创世之力"<<endl;
				jnn[9]=1;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==11){
		cout<<"him分身:攻击3500,防御15000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(3500,15000);
			if(l)
			{
				cout<<"你打赢了,获得了him的一些力量"<<endl;
				cnt+=10;
				a+=30;
				b+=100;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==4){
		cout<<"财神:攻击5500,防御9000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(5500,9000);
			if(l)
			{
				cout<<"你打赢了,获得了100钻石"<<endl;
				money2+=100;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==13){
		cout<<"财神小弟:攻击2500,防御6000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(2500,6000);
			if(l)
			{
				cout<<"你打赢了,获得了10钻石"<<endl;
				money2+=10;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==14){
		cout<<"恶魔:攻击2100,防御4100 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(2100,4100);
			if(l)
			{
				cout<<"你打赢了,获得了23金币"<<endl;
				money1+=23;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==14){
		cout<<"小恶魔:攻击1200,防御3000 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1";
			money1--;
			return ;
		} else{
			bool l=zhan(1200,3000);
			if(l)
			{
				cout<<"你打赢了,获得了8金币"<<endl;
				money1+=8;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==15){
		srand(time(0));
		int m1=rand()%10;
		cout<<"你获得了 "<<m1<<"枚金币"<<endl;
		money1+=m1;
	}
	if(x==0){
		srand(time(0));
		int m1=rand()%2;
		cout<<"你获得了 "<<m1<<"枚钻石"<<endl;
		money2+=m1;
	}
	return ;
}
void vs(){
	system("cls");
	cout<<"(1)神"<<endl;
	cout<<"(2)超神"<<endl;
	cout<<"(3)真神"<<endl;
	cout<<"(4)神王"<<endl;
	cout<<"(5)神尊"<<endl;
	int x;
	cin>>x;
	if(x==1)
	{
		cout<<"人机:攻击620,防御1252"<<endl;
		bool l=zhan(620,1252);
		if(l)
		{
			cout<<"你打赢了"<<endl;
			cnt++;
			return ;
		}
		else
		{
			cout<<"你输了 金币-12"<<endl;
			money1-=12;
			return ;
		}
	}
	if(x==2)
	{
		cout<<"人机:攻击720,防御1452"<<endl;
		bool l=zhan(720,1452);
		if(l)
		{
			cout<<"你打赢了"<<endl;
			cnt+=2;
			return ;
		}
		else
		{
			cout<<"你输了 金币-23"<<endl;
			money1-=23;
			return ;
		}
	}
	if(x==3)
	{
		cout<<"人机:攻击820,防御1652"<<endl;
		bool l=zhan(820,1652);
		if(a+b>820+852 )
		{
			cout<<"你打赢了,获得34金币"<<endl;
			cnt+=3;
			return ;
		}
		else
		{
			cout<<"你输了 金币-34"<<endl;
			money1-=34;
			return ;
		}
	}
	if(x==4)
	{
		cout<<"人机:攻击920,防御1852"<<endl;
		bool l=zhan(920,1852);
		if(l)
		{
			cout<<"你打赢了,获得12金币"<<endl;
			money1+=12;
			return ;
		}
		else
		{
			cout<<"你输了 金币-12"<<endl;
			money1-=12;
			return ;
		}
	}
	if(x==5)
	{
		cout<<"人机:攻击1020,防御2052"<<endl;
		bool l=zhan(2020,2052);
		if(l)
		{
			cout<<"你打赢了,获得12金币"<<endl;
			money1+=12;
			return ;
		}
		else
		{
			cout<<"你输了 金币-12"<<endl;
			money1-=12;
			return ;
		}
	}
	return ;
}
void lilian(){
	system("cls");
	srand(time(0));
	int x=rand()%10;
	if(x<=3){
		cout<<"赵云:攻击415,防御416 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1"<<endl;
			money1--;
			return ;
		} else{
			bool l=zhan(415,416);
			if(l)
			{
				cout<<"你打赢了,获得25金币,2钻石"<<endl;
				money1+=25;
				money2+=2;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x>3&&x<=5){
		cout<<"张辽:攻击431,防御386 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1"<<endl;
			money1--;
			return ;
		} else{
			bool l=zhan(431,386);
			if(l)
			{
				cout<<"你打赢了,获得20金币,2钻石"<<endl;
				money1+=20;
				money2+=2;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x>5&&x<=8){
		cout<<"董卓:攻击115,防御116 "<<endl<<" 1. 攻击 2.逃跑"<<endl;
		int c;
		cin>>c;
		if(c==2){
			cout<<"你跑了 金币-1"<<endl;
			money1--;
			return ;
		} else{
			bool l=zhan(115,116);
			if(l)
			{
				cout<<"你打赢了,获得10金币"<<endl;
				money1+=10;
			}
			else
			{
				if(c==0){
					cout<<"你死了" <<endl;
					s=1;
					return ;
				}
				c--;
			}
		}
	}
	if(x==9){
		srand(time(0));
		int m1=rand()%5;
		cout<<"你获得了 "<<m1<<"枚钻石"<<endl;
	}
	if(x==10){
		srand(time(0));
		int m1=rand()%10;
		cout<<"你获得了 "<<m1<<"枚金币"<<endl;
	}
	return ;
}
void zhanchang(){
	system("cls");
	cout<<"(1)华雄(普通)"<<endl;
	cout<<"(2)黄盖(进阶)"<<endl;
	cout<<"(3)关羽(困难)"<<endl;
	cout<<"(4)诸葛亮(噩梦)"<<endl;
	cout<<"(5)小兵(容易)"<<endl;
	cout<<"(6)张飞(困难)"<<endl;
	cout<<"(7)吕布(噩梦)"<<endl;
	cout<<"(8)黄忠(困难)"<<endl;
	cout<<"(9)刘备(地狱)"<<endl;
//	cout<<"(10)周瑜(困难)"<<endl;
	int v;
	cin>>v;
	if(v==1)
	{
		cout<<"华雄:攻击45,防御46"<<endl;
		bool  l=zhan(45,46);
		if(l)
		{
			cout<<"你打赢了,获得5金币"<<endl;
			money1+=5;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==2)
	{
		cout<<"黄盖:攻击160,防御152"<<endl;
		bool  l=zhan(160,152);
		if(l)
		{
			cout<<"你打赢了,获得12金币"<<endl;
			money1+=12;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==3)
	{
		cout<<"关羽:攻击378,防御365"<<endl;
		bool  l=zhan(378,365);
		if(l)
		{
			cout<<"你打赢了,获得30金币,1钻石"<<endl;
			money1+=30;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==4)
	{
		cout<<"诸葛亮:攻击512,防御518"<<endl;
		bool  l=zhan(512,518);
		if(a+b>512+518&& cnt>=25)
		{
			cout<<"你打赢了,获得53金币,3钻石"<<endl;
			money1+=53;
			money2+=3;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==5)
	{
		cout<<"小兵:攻击5,防御3"<<endl;
		bool  l=zhan(5,3);
		if(l)
		{
			cout<<"你打赢了,获得1金币"<<endl;
			money1+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==6)
	{
		cout<<"张飞:攻击380,防御356"<<endl;
		bool  l=zhan(380,356);
		if(l)
		{
			cout<<"你打赢了,获得28金币,1钻石"<<endl;
			money1+=28;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==7)
	{
		cout<<"吕布:攻击592,防御406"<<endl;
		bool  l=zhan(592,406);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==8)
	{
		cout<<"黄忠:攻击355,防御319"<<endl;
		bool  l=zhan(355,319);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==9)
	{
		cout<<"刘备:攻击1045,防御1246"<<endl;
		bool  l=zhan(1045,1246);
		if(l)
		{
			cout<<"你打赢了,获得10金币"<<endl;
			money1+=10;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	return ;
}
void zhanchang1(){
	system("cls");
	cout<<"(1)华雄(进阶)"<<endl;
	cout<<"(2)黄盖(困难)"<<endl;
	cout<<"(3)关羽(噩梦)"<<endl;
	cout<<"(4)诸葛亮(地狱)"<<endl;
	cout<<"(5)小兵(普通)"<<endl;
	cout<<"(6)张飞(噩梦)"<<endl;
	cout<<"(7)吕布(地狱)"<<endl;
	cout<<"(8)黄忠(噩梦)"<<endl;
	cout<<"(9)刘备(史诗)"<<endl;
//	cout<<"(10)周瑜(困难)"<<endl;
	int v;
	cin>>v;
	if(v==1)
	{
		cout<<"华雄:攻击145,防御346"<<endl;
		bool  l=zhan(145,146);
		if(l)
		{
			cout<<"你打赢了,获得5金币"<<endl;
			money1+=5;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==2)
	{
		cout<<"黄盖:攻击360,防御1002"<<endl;
		bool  l=zhan(360,1002);
		if(l)
		{
			cout<<"你打赢了,获得12金币"<<endl;
			money1+=12;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==3)
	{
		cout<<"关羽:攻击678,防御1650"<<endl;
		bool  l=zhan(678,1650);
		if(l)
		{
			cout<<"你打赢了,获得30金币,1钻石"<<endl;
			money1+=30;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==4)
	{
		cout<<"诸葛亮:攻击1012,防御3518"<<endl;
		bool  l=zhan(1012,3518);
		if(a+b>512+518&& cnt>=25)
		{
			cout<<"你打赢了,获得53金币,3钻石"<<endl;
			money1+=53;
			money2+=3;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==5)
	{
		cout<<"小兵:攻击50,防御130"<<endl;
		bool  l=zhan(50,130);
		if(l)
		{
			cout<<"你打赢了,获得1金币"<<endl;
			money1+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==6)
	{
		cout<<"张飞:攻击780,防御1256"<<endl;
		bool  l=zhan(780,1256);
		if(l)
		{
			cout<<"你打赢了,获得28金币,1钻石"<<endl;
			money1+=28;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==7)
	{
		cout<<"吕布:攻击1392,防御3306"<<endl;
		bool  l=zhan(1392,3306);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==8)
	{
		cout<<"黄忠:攻击555,防御1519"<<endl;
		bool  l=zhan(555,1519);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==9)
	{
		cout<<"刘备:攻击2045,防御2246"<<endl;
		bool  l=zhan(2045,2246);
		if(l)
		{
			cout<<"你打赢了,获得10金币"<<endl;
			money1+=10;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	return ;
}
void zhanchang2(){
	system("cls");
	cout<<"(1)华雄(困难)"<<endl;
	cout<<"(2)黄盖(噩梦)"<<endl;
	cout<<"(3)关羽(地狱)"<<endl;
	cout<<"(4)诸葛亮(史诗)"<<endl;
	cout<<"(5)小兵(进阶)"<<endl;
	cout<<"(6)张飞(地狱)"<<endl;
	cout<<"(7)吕布(史诗)"<<endl;
	cout<<"(8)黄忠(地狱)"<<endl;
	cout<<"(9)刘备(传说)"<<endl;
//	cout<<"(10)周瑜(困难)"<<endl;
	int v;
	cin>>v;
	if(v==1)
	{
		cout<<"华雄:攻击345,防御1046"<<endl;
		bool  l=zhan(345,746);
		if(l)
		{
			cout<<"你打赢了,获得5金币"<<endl;
			money1+=5;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==2)
	{
		cout<<"黄盖:攻击660,防御2102"<<endl;
		bool  l=zhan(660,1402);
		if(l)
		{
			cout<<"你打赢了,获得12金币"<<endl;
			money1+=12;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==3)
	{
		cout<<"关羽:攻击1078,防4650"<<endl;
		bool  l=zhan(1078,2650);
		if(l)
		{
			cout<<"你打赢了,获得30金币,1钻石"<<endl;
			money1+=30;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==4)
	{
		cout<<"诸葛亮:攻击2012,防御8518"<<endl;
		bool  l=zhan(1012,3518);
		if(a+b>512+518&& cnt>=25)
		{
			cout<<"你打赢了,获得53金币,3钻石"<<endl;
			money1+=53;
			money2+=3;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==5)
	{
		cout<<"小兵:攻击150,防御530"<<endl;
		bool  l=zhan(150,530);
		if(l)
		{
			cout<<"你打赢了,获得1金币"<<endl;
			money1+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==6)
	{
		cout<<"张飞:攻击1080,防御4256"<<endl;
		bool  l=zhan(1080,4256);
		if(l)
		{
			cout<<"你打赢了,获得28金币,1钻石"<<endl;
			money1+=28;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==7)
	{
		cout<<"吕布:攻击2392,防御7906"<<endl;
		bool  l=zhan(2392,7906);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==8)
	{
		cout<<"黄忠:攻击1055,防御4519"<<endl;
		bool  l=zhan(1055,4519);
		if(l)
		{
			cout<<"你打赢了,获得100金币,1钻石"<<endl;
			money1+=100;
			money2+=1;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	if(v==9)
	{
		cout<<"刘备:攻击6045,防御12746"<<endl;
		bool  l=zhan(6045,12746);
		if(l)
		{
			cout<<"你打赢了,获得10金币"<<endl;
			money1+=10;
		}
		else
		{
			if(c==0){
				cout<<"你死了" <<endl;
				s=1;
				return ;
			}
			c--;
		}
	}
	return ;
}
int main()
{
	cout<<"请输入你的名字:";
	cin>>name;
	cout<<"第一章 变强"<<endl;
	cout<<"你是一名小兵,这个世界出现了混乱三国"<<endl;
	cout<<"你的梦想是征服世界,于是你踏上了旅途"<<endl;
	while(cnt<=80)
	{
		cout<<"你有"<<c+1<<"条命"<<endl;
		cout<<"金币:"<<money1<<" ,钻石:"<<money2<<" ,体力: "<<tl<<endl;
		cout<<name<<':'<<cnt<<"级";
		denji();
		cout<<"(1)商店"<<endl;
		cout<<"(2)练兵"<<endl;
		cout<<"(3)战场"<<endl;
		cout<<"(4)打工"<<endl;
		cout<<"(5)彩票"<<endl;
		if(cnt>=100){
			cout<<"(6)历练"<<endl;
		}
		if(cnt>=350){
			cout<<"(7)对战"<<endl;
		}
		if(cnt>=600){
			cout<<"(8)域外"<<endl;
		}
		cout<<"攻击:"<<a<<"血量:"<<b<<endl;
		int x;
		cin>>x;
		if(x==1)
		{
			shangdian();
		}
		if(x==2)
		{
			xiulian();
		}
		if(x==3){
			zhanchang();
			if(s==1){
				return 0;
			}
		}
		if(x==4&&tl>0){
			dagong();
		}
		if(x==4&&tl<=0){
			cout<<"你没体力了"<<endl;
		}
		if(x==5){
			cout<<"(1)10元"<<endl;
			cout<<"(2)20元"<<endl;
			cout<<"(3)50元"<<endl;
			cout<<"(4)100元"<<endl;
			caipiao();
		}
		if(x==6&&cnt>=100){
			lilian();
			if(s==1){
				return 0;
			}
		}
		if(x==7&&cnt>=350){
			vs();
		}
		if(x==8&&cnt>=600){
			yuwai();
		}
	}
	cout<<"第二章 修炼"<<endl;
	cout<<"你成了第一强者但灵气复苏"<<endl;
	cout<<"你又需要修炼"<<endl;
	while(cnt<=400)
	{
		cout<<"你有"<<c+1<<"条命"<<endl;
		cout<<"金币:"<<money1<<" ,钻石:"<<money2<<" ,体力: "<<tl<<endl;
		cout<<name<<':'<<cnt<<"级";
		denji();
		cout<<"(1)商店"<<endl;
		cout<<"(2)练兵"<<endl;
		cout<<"(3)战场"<<endl;
		cout<<"(4)打工"<<endl;
		cout<<"(5)彩票"<<endl;
		if(cnt>=100){
			cout<<"(6)历练"<<endl;
		}
		if(cnt>=350){
			cout<<"(7)对战"<<endl;
		}
		if(cnt>=600){
			cout<<"(8)域外"<<endl;
		}
		cout<<"攻击:"<<a<<"血量:"<<b<<endl;
		int x;
		cin>>x;
		if(x==1)
		{
			shangdian();
		}
		if(x==2)
		{
			xiulian();
		}
		if(x==3){
			zhanchang1();
			if(s==1){
				return 0;
			}
		}
		if(x==4&&tl>0){
			dagong();
		}
		if(x==4&&tl<=0){
			cout<<"你没体力了"<<endl;
		}
		if(x==5){
			cout<<"(1)10元"<<endl;
			cout<<"(2)20元"<<endl;
			cout<<"(3)50元"<<endl;
			cout<<"(4)100元"<<endl;
			caipiao();
		}
		if(x==6&&cnt>=100){
			lilian();
			if(s==1){
				return 0;
			}
		}
		if(x==7&&cnt>=350){
			vs();
		}
		if(x==8&&cnt>=600){
			yuwai();
		}
	}
		cout<<"第三章 大世界"<<endl;
		cout<<"一个声音传来,你有资格进入大世界"<<endl;
		cout<<"你还没反应过来就感觉一阵头晕目眩"<<endl;
		cout<<"你醒了"<<endl;
		cout<<"你发现眼前的世界人都很强"<<endl;
		cout<<"? : 喂!"<<"快过来"<<endl;
		cout<<name<<": 你是谁 ?"<<endl;
		cout<<"? : 我叫王小天是总部派来接相你一样从小世界出来的人"<<endl;
		cout<<"王小天带你到了一个地方"<<endl;
		cout<<"王小天 : 你去登记一下"<<endl;
		cout<<"你登记了身份"<<endl;
		cout<<"你下定决心要成为强者"<<endl;
	while(cnt<=850)
	{
		cout<<"你有"<<c+1<<"条命"<<endl;
		cout<<"金币:"<<money1<<" ,钻石:"<<money2<<" ,体力: "<<tl<<endl;
		cout<<name<<':'<<cnt<<"级";
		denji();
		cout<<"(1)商店"<<endl;
		cout<<"(2)练兵"<<endl;
		cout<<"(3)战场"<<endl;
		cout<<"(4)打工"<<endl;
		cout<<"(5)彩票"<<endl;
		if(cnt>=100){
			cout<<"(6)历练"<<endl;
		}
		if(cnt>=350){
			cout<<"(7)对战"<<endl;
		}
		if(cnt>=600){
			cout<<"(8)域外"<<endl;
		}
		cout<<"攻击:"<<a<<"血量:"<<b<<endl;
		int x;
		cin>>x;
		if(x==1)
		{
			shangdian();
		}
		if(x==2)
		{
			xiulian();
		}
		if(x==3){
			zhanchang2();
			if(s==1){
				return 0;
			}
		}
		if(x==4&&tl>0){
			dagong();
		}
		if(x==4&&tl<=0){
			cout<<"你没体力了"<<endl;
		}
		if(x==5){
			cout<<"(1)10元"<<endl;
			cout<<"(2)20元"<<endl;
			cout<<"(3)50元"<<endl;
			cout<<"(4)100元"<<endl;
			caipiao();
		}
		if(x==6&&cnt>=100){
			lilian();
			if(s==1){
				return 0;
			}
		}
		if(x==7&&cnt>=350){
			vs();
		}
		if(x==8&&cnt>=600){
			yuwai();
		}
	}
		//cout<<"第章 出击"<<endl;
	//	cout<<"黑血大界入侵 无数百姓死于非命(百姓对作者说:我你********)"<<endl;
		//cout<<"于是你为了让作者不被人骂死踏上了旅途....."<<endl;
	return 0;
}
原文