#include<bits/stdc++.h>
#include<Windows.h>
using namespace std;
int fy,gj;
int zdq;
long long f=500;
int jdxr=100;
int i;
string x;
int q;
int t;
int rq=2;
int r=3000;
int w=rand();
int bt;
int xr;
double qw;
int tre;
int sq=100;
void dfs(int in){
if(in==1){
f=f-300;
}
while(f>0&&r>=0&&sq>=50){
cout<<"公元"<<rq<<"年"<<endl<<endl;
cout<<"军队人数:"<<f<<" 钱数:"<<r<<" 攻击:"<<gj<<" 防御:"<<fy<<" 士气: "<<sq<<endl<<endl;
cout<<"你选择 1.招兵买马(增加军队200人) 2.进攻它地(概率领土扩大,士气增加 否则军队伤亡,士气减少) 3.搞钱 4.商城"<<endl<<endl;
cin>>t;
int zdq=0;
if(t==1){
cout<<"你获得了200人"<<endl<<endl;
cout<<"军队增加到"<<f+200<<"人"<<endl<<endl;
f=f+200;
cout<<"钱数减少1000"<<endl<<endl;
cout<<"钱数减少到"<<r-1000<<endl<<endl;
r=r-1000;
Sleep(3000);
}else if(t==2){
if(w%2!=0){
cout<<"你战胜了!"<<endl<<endl;
cout<<"你获得了2000元,100人"<<endl<<endl;
r=r+2000;
f=f+100;
Sleep(3000);
zdq++;
sq=sq+20;
if(zdq==100){
cout<<"游戏胜利!!!"<<endl<<endl;
cout<<"感谢您的游玩!!!"<<endl<<endl;
cout<<"再见!!!"<<endl;
break;
}
}else{
cout<<"你战败了"<<endl<<endl;
cout<<"军队减少1000"<<endl<<endl;
f=f-1000;
sq=sq-30;
Sleep(3000);
}
}else if(t==3){
cout<<"你要投资药品吗?"<<endl<<endl;
cout<<"1.投 2.不投"<<endl<<endl;
cin>>bt;
if(bt==1){
cout<<"输入你要投多少"<<endl<<endl;
cin>>qw;
if(qw>r){
cout<<"拜拜"<<endl<<endl;
Sleep(3000);
break;
}else{
if(xr<=100){
r=r-qw;
cout<<"投的钱数*1.5"<<endl<<endl;
qw=qw*1.5;
r=r+qw;
}else{
r=r-qw;
cout<<"投的钱数/1.5"<<endl<<endl;
qw=qw/1.5;
r=r+qw;
}
}
}else if(bt==2){
cout<<"6"<<endl<<endl;
}else if(t==4){
cout<<"欢迎来到商城"<<endl<<endl;
cout<<"在这里你可以买到你需要的东西"<<endl<<endl;
cout<<"1.防具 1000元(增加1000防御) 2.武器 10000元(增加5000攻击) 3.返回"<<endl<<endl;
cin>>tre;
if(tre==1){
if(r>=1000){
cout<<"购买成功!!!"<<endl<<endl;
r=r-1000;
fy=fy+1000;
Sleep(3000);
system("cls");
}else{
cout<<"抱歉你的钱数不够,购买失败......"<<endl<<endl;
Sleep(3000);
system("cls");
}