#include<bits/stdc++.h>
using namespace std;
int main(){
	int a=5,A=0,c=0,n=3,B=0,i,j,q=2,tz=0,sw=150,p;
	cout<<"尼哥模拟器"<<endl;
	cout<<"你每天可以播种棉花,摘棉花,卖棉花,每天可进行的行为数取决于你拥有的尼哥数"<<endl; 
	while(1){
	cout<<"你拥有:"<<a<<"个种子  "<<A<<"个棉花  "<<c<<"个金钱  "<<n<<"个尼哥   "<<B<<"个棉花已成熟  "<<q<<"颗子弹  "<<sw<<"声望"<<endl;
	cout<<"请输入1,播种种子;2,摘棉花;3,卖棉花;4,买尼哥;5,将棉花做成种子;6,去附近抢棉花和尼哥;7,买子弹"<<endl; 
	cin>>i;
	if(i==1){
		cout<<"输入要播种种子数"<<endl;
		cin>>j;
		if(j<=n*2&&j<=a){
			a-=j;
			B+=j;
		}else{
			cout<<"错误"<<endl; 
		}
	}
	if(i==2){
		cout<<"输入要摘棉花数" <<endl;
		cin>>j;
		if(j<=n*2&&j<=B){
			B-=j;
			A+=j;
		}else{
			cout<<"错误"<<endl; 
		}
	}
	if(i==3){
		cout<<"输入要卖棉花数"<<endl;
		cin>>j;
		if(j<=n*2&&j<=A){
			A-=j;
			c+=j;
			sw+=j;
		}else{
			cout<<"错误"<<endl; 
		}
	}
	if(i==4){
		cout<<"输入要买尼哥数(15coin一个)"<<endl;
		cin>>j;
		if(j*15<=c){
			c=c-j*15;
			n+=j;
			sw+=5*j;
			sw+=j*50;
		}else{
			cout<<"错误"<<endl; 
		}
	}
	if(i==5){
		cout<<"输入要制作种子数"<<endl;
		cin>>j;
		if(j<=n&&j<=A){
			A-=j;
			a+=j*2;
		}else{
			cout<<"错误"<<endl; 
		}
	}
	if(i==6){
		cout<<"输入要抢尼哥和棉花数(7子弹一只尼哥,1子弹4个棉花,棉花数需为4倍数)"<<endl;
		cin>>j>>p;
		if(p%4!=0) {
			cout<<"错误"<<endl;
		}else if(j*7+p/4<=q) {
			n+=j;
			A+=p;
			q-=j*7+p/4;
			sw-=j*30+p*3;
		}else{
			cout<<"错误"<<endl;
		}
	}
	if(i==7){
		cout<<"输入要买子弹数"<<endl;
		cin>>j;
		if(j*3<=c){
			q+=j;
			c-=j*3;
		}
	}
	if(c>=300){
		cout<<endl<<endl<<endl<<endl;
		cout<<"达成结局:富可敌国";
		return 0;
	}
	if(n>=32){
		cout<<endl<<endl<<endl<<endl;
		cout<<"达成结局:'真'农场主";
		return 0; 
	}
	if(A==0&&B==0&&a==0){
		cout<<endl<<endl<<endl<<endl<<"由于没有棉花可种,你破产了";
		return 0;
	}
	if(sw<=0){
		cout<<endl<<endl<<endl<<endl<<"由于你声望过低,你被别的农场主枪毙了";
		return 0; 
	}
	cout<<endl;
	cout<<endl;
	cout<<endl;
	}
	return 0;
}