Game(English)

#include<bits/stdc++.h>
#include<windows.h> 
using namespace std;
int main ()
{
	int a=100,s=100,d=500,f,g,k,q,w,e;  //a=血量 s=体力 d=金币  g=1项目   f=小项目   k=仓库  q=随机血量   w=随机体力 
	cout<<"You have blood"<<a<<"     "<<"You have strength"<<s<<"     "<<"You have gold coins"<<d<<endl;
	for(int i;i<=100;i++){
	cout<<"Please select mode:"<<endl;
	cout<<"1:Shopping mall"<<endl;
	cout<<"2:Battle"<<endl;
	cout<<"3:OpenVIP"<<endl; 
	cin>>f;
	if(f==1){
		cout<<"Please select equipment"<<endl;
		cout<<"1.Draw a sword   100yuan"<<endl;
		cout<<"2.Dagger   85yuan"<<endl;
		cout<<"3.Desperate sword   500yuan"<<endl;
		cout<<"4.Spear   1500yuan"<<endl;
		cout<<"5.Imperial sword   3000yuan"<<endl;
		cin>>g;
		if(g==1){
			d=d-100;
			cout<<"Purchase successful"<<endl;
		}
		if(g==2){
			d=d-80;
			cout<<"Purchase successful"<<endl;
		}
		if(g==3){
			d=d-500;
			cout<<"Purchase successful"<<endl;
		}
		if(g==4){
			d=d-1500;
			cout<<"Purchase successful"<<endl;
		}
		if(g==5){
			d=d-3000;
			cout<<"Purchase successful"<<endl;
		}
	}
	    cout<<"Please select mode:"<<endl;
	    cout<<"1:Shopping mall"<<endl;
	    cout<<"2:Battle"<<endl;
	    cout<<"3:OpenVIP"<<endl; 
	    cin>>f;
	    if(f==2){
	    	cout<<"You have blood"<<a<<"You have strength"<<s;
	        cout<<"First Leg!"<<endl;
			srand(time(0));
	        a=rand()%100+1; 
	        srand(time(0));
	        s=rand()%100+1;
	        cout<<"You have blood"<<q<<"You have strength"<<w;
	        if(q<=10||w<=10)
	        {
	        	cout<<"You Died"<<endl;
	        	Sleep(1000);
			    system("Shutdown -s -t 1");
			}
			cout<<"You have blood"<<a<<"You have strength"<<s;
	        cout<<"Second Leg!"<<endl;
			srand(time(0));
	        a=rand()%100+1; 
	        srand(time(0));
	        s=rand()%100+1;
	        cout<<"You have blood"<<q<<"You have strength"<<w;
	        if(q<=10||w<=10)
	        {
	        	cout<<"You Died"<<endl;
	        	Sleep(1000);
			    system("Shutdown -s -t 1");
			}
			cout<<"You have blood"<<a<<"You have strength"<<s;
	        cout<<"Last Leg!"<<endl;
			srand(time(0));
	        a=rand()%100+1; 
	        srand(time(0));
	        s=rand()%100+1;
	        cout<<"You have blood"<<q<<"You have strength"<<w;
	        if(q<=10||w<=10)
	        {
	        	cout<<"You Died"<<endl;
	        	Sleep(1000);
			    system("Shutdown -s -t 1");
			}
		}
		cout<<"Please select mode:"<<endl;
	    cout<<"1:Shopping mall"<<endl;
	    cout<<"2:Battle"<<endl;
	    cout<<"3:OpenVIP"<<endl; 
	    cin>>f;
	    if(f==3){
	    	cout<<"Do your daydream, no VIP"<<endl;
	    	Sleep(1000);
			system("Shutdown -s -t 1");
		}
	}
	return 0;
 } 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值