• 个人简介

    
    
    #include<bits/stdc++.h>
    #include<windows.h>
    using namespace std;
    long long money;
    int op;
    int cnt;
    int sum;
    int tnt;
    int a[4]={15,25,20,10};
    int b[5]={10,20,30,20,10};
    int ran(){
      int a=rand();
    	return a;
    }
    void p2(){
    	sum=ran()%3;
    	money+=a[sum];
    	cout<<"you have "<<a[sum]<<" yuan\n";
    	return ;
    }
    void p3(){
    	tnt=ran()%5;
    	cout<<"________________\n";
    	cout<<"|10|20|30|20|10|\n";
    	cout<<"________________\n";
    	cout<<"you have "<<b[tnt]<<" yuan\n";
    	money+=b[tnt];
    	return;
    }
    void play(){
    	money-=3;
    	cnt=ran()%8+1;
    	cout<<"you see "<<cnt<<endl;
    	if(cnt==1){
    		money+=2;
    		cout<<"you have 2 yuan\n";
    	}
    	if(cnt==2){
    		cout<<"no thing\n";
    	}
    	if(cnt==3){
    		money+=3;
    		cout<<"you have 3 yuan\n";
    	}
    	if(cnt==4){
    		money-=3;
    		cout<<"you have -3 yuan\n";
    	}
    	if(cnt==5){
    		money+=10;
    		cout<<"you have 10 yuan\n";
    	}
    	if(cnt==6){
    		money+=5;
    		cout<<"you have 5 yuan\n";
    	}
    	if(cnt==7){
    		cout<<"you have a big zhuanpan(chinese)\n";
    		p2();
    	}
    	if(cnt==8){
    		cout<<"you have a bao_xiang(chinese)\n";
    		p3();
    	}
    	return;
    }
    void solve(){
    	if(money<0){
    		cout<<"GAME OVER! your money is negative.\n";
    		return;
    	}
    	cout<<"1 to play(-3 money) 2 to look your money\n";
    	cin>>op;
    	if(op==1) play();
    	else cout<<"you have "<<money<<" yuan";
    	cout<<"\n do you want to esc?\n";
    	cout<<"1 yes 0 no\n";
    	cin>>op;
    	if(op==1) return;
    	else solve();
    }
    signed main(){
    	HWND h=GetConsoleWindow();
    	ShowWindow(h,SW_MAXIMIZE);
    	money = 10;
    	cout<<"welcome to play this game.ALL in tuhua and yeyijun";
    	cout<<"\nthis code typed by tuhua (https://www.luogu.com.cn/user/2203394)\n";
    	cout<<"this code was yeyijun(http://154.44.26.231:8888/user/763) to tell tuhua to make it by DEV-C++ on huawei Matebook13 \n";
    	cout<<"you mustn`t to tell another people that this code was you typed\n";
    	cout<<"else the police could see you\n";
    	cout<<"please run by c++11\n";
    	solve();
    	return 0;
    }
    
    
    
    
  • 通过的题目

  • 最近活动

  • 最近编写的题解

    This person is lazy and didn't write any solutions.

题目标签

语言入门
2
选择语句
2
字符串
1
分支结构
1
循环结构
1
模拟
1
普及-
1
入门
1
运算
1