• 个人简介

    #include<iostream>
    #include<bits/stdc++.h>
    #include<cmath>
    #include<iomanip>
    #include<windows.h>
    #define endl "\n"
    #define A 150
    using namespace std;
    long long int i,j,k,a[15],sj,b[15],d,db=0,xz,bs;
    long long int p[15],cp1,cp2,tx,bf1,bf2,day=1,a6,a7;
    long long int pp[A],gs=250,sl,su=1,xz1,x1,sg=250;
    bool q1,ll=true;
    void datdh(int all){
    	Sleep(2000);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"  o                 "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"    o               "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"     o              "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"      o             "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"       o            "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"        o           "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"         o          "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"          o         "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"           o        "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	Sleep(400);
    	system("cls");
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"                    "<<endl;
    	cout<<"  o                 "<<endl;
    	Sleep(1000);
    	system("cls");
    	cout<<"第";
    	Sleep(1000);
    	system("cls");
    	cout<<"第"<<all;
    	Sleep(1000);
    	system("cls");
    	cout<<"第"<<all<<"天";
    	Sleep(1000);
    	system("cls");
    }
    struct wp{
    	string wn;
    	int jg;
    };
    struct bb{
    	string nz;
    	int sl;
    };
    wp a1[A];
    bb a2[A];
    wp a3[A];
    wp a4[A];
    void hs();
    string gs1(string x,int z){
    	int a=x.size()-2;
    	for(i=0;i<=a;++i){
    		Sleep(z);
    		cout<<x[i];
    	}
    	string y;
    	y+=x[a+1];
    	return y;
    }
    void cj(){
    	cout<<"出G"<<endl;
    	cin>>xz;
    	if(db<xz){
    		gs1("sbsbsbsbsbsbsbsbsbsbsbsbsbsbsb......",200);return;
    	}
    	db-=xz;
    	Sleep(1000);
    	system("cls");
    	cout<<gs1("规则:抽奖(1%*100 2%*50 5%*10 10%*5 50%*1 32%*0.1",150);
    	Sleep(100);
    	system("cls");
    	srand(time(0));
    	int x=rand()%200+1;
    	if(x==200){
    	cout<<"G币加"<<xz*100;db+=(xz*100);	
    	}
    	else if(x>=198){
    	cout<<"G币加"<<xz*50;db+=(xz*50);
    	}
    	else if(x>=193){
    		cout<<"G币加"<<xz*10;db+=(xz*10);
    	}
    	else if(x>=183){
    		cout<<"G币加"<<xz*5;db+=(xz*5);
    	}
    	else if(x>=133){
    		cout<<"G币加"<<xz;db+=(xz);
    	}else{
    		cout<<"G币加"<<x*0;db+=(xz*0);
    	}
    	Sleep(1500);
    	system("cls");
    }
    void cs(){
    	a1[1]={"铅笔",3};
    	a1[2]={"橡皮",2};
    	a1[3]={"草",10};
    	a1[4]={"土",5};
    	a1[5]={"木头",4};
    	a1[6]={"铁锭",30};
    	a1[7]={"铁钉",2};
    	a1[8]={"铜线",10};
    	a1[9]={"铜锭",20};
        a1[10]={"铝片",10};
        a1[11]={"铝块",100};
        a1[12]={"钻石",500};
        a1[13]={"黄金锭",2000};
        a1[14]={"黄金块",20000};
        a1[15]={"钛合金锭",5000};
        a1[16]={"钛合金块",50000};
        a1[17]={"面包",5};
        a1[18]={"大米",25};
        a1[19]={"一把塑料袋",5};
        a1[20]={"杯子",5};
    	a1[21]={"金坷垃",100};
        a1[22]={"可乐",5};
        a1[23]={"纸",10};
        a1[24]={"作业",10};
        a1[25]={"D老师的糖果",100000};
        a1[26]={"炸药",100};
        a1[27]={"邓鱼",20};
        a1[28]={"鱼项航(只是鱼名)",10};
        a1[29]={"橘子",5};
        a1[30]={"香蕉",5};
    }
    void bg(){
    	Sleep(1000);
    	system("cls");
    	while(1){
    	cout<<"格子:"<<gs<<"/"<<sg<<endl; 
    	for(i=1;i<=su;++i){
    		if(a2[i].sl<=0){
    		}else{
    			cout<<a2[i].nz<<" 数量:"<<a2[i].sl<<endl;
    		}
    	}
    	cout<<"扣1,买格"<<endl;
    	cout<<"扣2,退出"<<endl;
    	cin>>xz;
    	if(xz==1){
    		cout<<"输入你想买的格数(10G/格)"<<endl; 
    		cin>>sl;
    		Sleep(1000);
    	    system("cls");
    		if(db<(sl*10)){
    			for(i=1;i<=10000;++i){
    				Sleep(1);
    				cout<<"撒B!没钱别买!"<<endl;
    			}
    			
    			
    			return ;
    		}else{
    			cout<<"机付包减"<<(sl*10)<<"G";
    			db-=(sl*10);
    			Sleep(1000);
    	        system("cls");
    			cout<<"格子加  "<<sl;
    			sg+=sl;
    			gs+=sl;
    			Sleep(1000);
    		} 
    	}
    	if(xz==2){
    		Sleep(1000);
    	    system("cls");
    	    break;
    	}
    	system("cls");	
    	}
    	 
    }
    void sxmm(){
    	int sb;
    	for(i=1;i<=10;++i)pp[i]=0;
    	srand(time(0));
    	for(i=1;i<=10;++i){
    		q1=true;
    		sb=rand()%30+1;
    		for(j=1;j<=i;j++){
    			if(sb==pp[j]){
    				i--;q1=false;break;
    			}
    		}
    		pp[i]=sb;
    		if(q1==false){
    			continue;i--;
    		}
    	a4[i]=a3[i]=a1[sb];
    	}
    	srand(time(0));
    	for(i=1;i<=10;i++){
    		sb=rand()%2+1;
    		if(sb==1){
    			sb=rand()%a3[i].jg;
    			a3[i].jg+=sb;
    		}
    		if(sb==2){
    			sb=rand()%a3[i].jg;
    			a3[i].jg-=sb;
    		}
    	}
    }
    void mm(){
    	Sleep(1000);
    	system("cls");
    	while(1){
    		cout<<"每天都会刷新"<<endl;
    		cout<<"机付包:"<<db<<"G"<<endl;
    	for(i=1;i<=10;++i){
    		cout<<"扣"<<i<<",购买或出售  "<<a3[i].wn<<" 价格:"<<a3[i].jg<<"G"<<" 市场价:"<<a4[i].jg<<endl;
    	}
    	cout<<"扣11,打开背包"<<endl;
    	cout<<"扣12,退出"<<endl;
    	cin>>xz;
    	if(xz<=10){
    		Sleep(1000);
    	    system("cls");
    	    cout<<"扣1,购买"<<endl;
    		cout<<"扣2,出售"<<endl;
    		cin>>xz1;
    		if(xz1==1){
    			cout<<"输入想买的数量"<<endl;
    		    cin>>sl;
    		if(db-(sl*a3[xz].jg)<0){
    			Sleep(1000);
    	        system("cls");
    	        cout<<"G不够"<<endl;
    	        Sleep(1000);
    	        system("cls");
    	        cout<<"你被踢出去了"<<endl;
    	        return ;
    		}else if(gs<sl){
    			Sleep(1000);
    	        system("cls");
    			cout<<"你不能买那么多"<<endl; 
    			Sleep(1000);
    			continue;
    		}
    		Sleep(1000);
    	    system("cls");
    		cout<<"机付包减"<<sl*a3[xz].jg<<"G"<<endl;
    		db-=(sl*a3[xz].jg);
    		Sleep(1000);
    	    system("cls");
    	    cout<<"背包加 "<<a3[xz].wn<<"X"<<sl;
    	    gs-=sl;
    	    for(i=1;i<=su;++i){
    	    	if(a2[i].nz==a3[xz].wn){
    	    		a2[i].sl+=sl;break;
    			}else if(i==su){
    				a2[i].nz=a3[xz].wn;
    				a2[i].sl=sl;
    				su++;
    				break;
    			}
    		}
    		} 
    		if(xz1==2){
    			cout<<"输入你想卖的数量"<<endl;
    			cin>>sl;
    			for(i=1;i<=su;++i){
    				if(a2[i].nz==a3[xz].wn){
    					x1=i;break;
    				}else if(i==su){
    					Sleep(1000);
    	                system("cls");
    	                cout<<"你没有这个物品"<<endl;
    	                Sleep(1000);
    	                system("cls");
    	                cout<<"你被踢出去了"<<endl;
    	                Sleep(1000);
    	                system("cls");
    	                return ;
    				}
    			}
    			if(a2[x1].sl<sl){
    				Sleep(1000);
    	            system("cls");
    				cout<<"你没有那么多"<<endl;
    				Sleep(1000);
    	            system("cls");
    				continue;
    				Sleep(1000);
    	            system("cls");
    			}
    			Sleep(1000);
    	    	system("cls");
    			cout<<"机付包加"<<sl*a3[xz].jg<<"G"<<endl;
    			db+=(sl*a3[xz].jg);
    			Sleep(1000);
    	   	    system("cls");
    	    	cout<<"背包减 "<<a2[x1].nz<<"X"<<sl;
    	   	    gs+=sl;
    	   	    a2[x1].sl-=sl;
    		}
    		Sleep(1000);
    	    system("cls"); 
    	}
    	if(xz==11){
    		bg();
    	}
    	if(xz==12){
    		break;
    	}
    	system("cls");	
    	}	
    }
    void kt(){
    for(i=5;i>=1;--i){cout<<"  G币人生"<<endl;cout<<setw(5)<<i<<"S";Sleep(1000);system("cls");}system("cls");a6=7432;a7=30;
    cout<<"欢迎来到G币人生"<<endl;
    Sleep(2000);
    cout<<"这里你需要通过不同的方法赚G币"<<endl;
    Sleep(3000);
    system("cls"); 
    cout<<"开始吧!"<<endl;
    Sleep(2000);
    system("cls");
    cout<<"我将给你10个G币"<<endl;
    db=10; 
    Sleep(2000);
    cout<<"机付包到账10G"<<endl;
    Sleep(3000);
    system("cls");	
    }
    void gg(){
    	Sleep(1000);
    	system("cls");
    	Sleep(1000);
    	cout<<"广告开始";
    	Sleep(1000);
    	system("cls"); 
    	hs();
    	Sleep(2000);
    	system("cls");
    	cout<<"机付包到账5G";
    	db+=5;
    	Sleep(1000);
    	system("cls"); 
    }
    void kp(){
    	Sleep(1000);
    	system("cls");
    	cout<<"出G(赢了你将得两倍)"<<endl;
    	bf1=0;bf2=0; 
    	cin>>bs;
    	if(db<bs){
    	cout<<"余额不足";
    	Sleep(1000);
        system("cls");
        cout<<"你被踢出去了!!!";
    	Sleep(1000);
        system("cls"); 
        return;
        }
        db-=bs;
        cout<<"机付包减"<<bs<<"G"<<endl;
        Sleep(1000);
        system("cls");
        cout<<"规则:"<<endl;
    	cout<<"你将得到5张牌,你可以出任意一张,只能出有的,4>3>2>1,1可以干掉4"<<endl; 
    	system("pause");
        system("cls");
        srand(time(0));
        for(i=1;i<=5;++i){
        	p[i]=rand()%4+1;
    	}
    	srand(time(0));
    	for(i=1;i<=5;++i){
    		Sleep(1000);
    		system("cls");
    		cout<<"对方:你 "<<bf1<<":"<<bf2<<endl; 
    		cout<<"第"<<i<<"回合";
    		tx=0;
    		Sleep(2000);
            system("cls");
            srand(time(0)); 
    		cp1=rand()%2+1;
    		srand(time(0)); 
    		if(cp1==1){
    			cp1=rand()%3+1;
    		}
    		if(cp1==2){
    			cp1=rand()%4+1;
    		}
    		for(j=1;j<=5;++j){
    			if(p[j]!=0){
    			cout<<p[j]<<" ";	
    			}
    		}
    		cout<<endl;
    		while(1){
    			if(tx==1){
    			cout<<"再次";	
    			}
    			tx=0;
    		cout<<"出牌"<<endl;
    		cin>>cp2;
    		for(j=1;j<=5;++j){
    			if(p[j]==cp2){
    				break;
    			}else{
    				if(j==5){
    					cout<<"不能出没有的牌"<<endl;tx=1;
    				}
    			}
    		}
    		if(tx==0){
    			for(j=1;j<=5;++j){
    				if(p[j]==cp2){
    					p[j]=0;break;
    				}
    			}
    			break;
    		}	
    		}
    		Sleep(500);
            system("cls");
    		cout<<"?对方   你?";
    		Sleep(500);
            system("cls");
            cout<<"  对?   ? ";
    		Sleep(500);
            system("cls");
            cout<<"  对方"<<cp1<<" "<<cp2<<"你";
    		Sleep(500);
            system("cls");
            if(cp1<cp2){
            	if(cp1==1&&cp2==4){
            		cout<<"  对方"<<cp1<<"  "<<"你";tx=1;
    			}else{
    				cout<<"  对方"<<"  "<<cp2<<"你";tx=0;
    			}
    		}
    		if(cp1>cp2){
            	if(cp1==4&&cp2==1){
            		cout<<"  对方"<<"  "<<cp2<<"你";tx=0;
    			}else{
    				cout<<"  对方"<<cp1<<"  "<<"你";tx=1;
    			}
    		}
    		if(cp1==cp2){
    			cout<<"  对方"<<"   "<<"你";tx=2;
    		}
    		Sleep(1000);
            system("cls");
    		if(tx==1){
    			cout<<"这回合你输了";
    			bf1++; 
    		}
    		if(tx==0){
    			cout<<"这回合你赢了";
    			bf2++; 
    		}
    		if(tx==2){
    			cout<<"这回合平局";
    		}
    	}
    	Sleep(2000);
    	system("cls");
    	    if(bf1>bf2){
    			cout<<"你输了";
    			bf1++; 
    		}
    		if(bf1<bf2){
    			cout<<"你赢了"<<endl;
    			bf2++; 
    			Sleep(1000);
    			cout<<"机付包到账"<<bs*2<<"G";
    			db+=(bs*2);
    			Sleep(1000);
    		}
    		if(bf1==bf2){
    			cout<<"平局"<<endl;
    			Sleep(1000);
    			cout<<"机付包到账"<<bs<<"G";
    			db+=bs;
    			Sleep(1000);
    		} 
    }
    void hm(){
    	for(i=1;i<=10;++i){
    		a[i]=0;
    	}
    Sleep(1000);
    system("cls");
    d=0;
    srand(time(0));
    cout<<"输入你想买的被数,1为1倍,2为2倍"<<endl;
    cin>>bs;
    if(db<bs){
    	cout<<"余额不足";
    	Sleep(1000);
        system("cls");
        cout<<"你被踢出去了!!!";
    	Sleep(1000);
        system("cls"); 
        return;
    }
    db-=bs;
    cout<<"机付包减"<<bs<<"G"<<endl;
    Sleep(1000);
    system("cls"); 
    cout<<"每对上一个你卖彩票的G乘2(第一次为你卖彩票的G)"<<endl;
    cout<<"输入你的号码(6位,0~30)"<<endl;
    cin>>b[1]>>b[2]>>b[3]>>b[4]>>b[5]>>b[6];
    Sleep(1000);
    system("cls");
    cout<<"5秒后开奖";
    Sleep(1000); 
    system("cls");
    for(i=4;i>=1;i--){
    	cout<<i<<"s";
    	Sleep(1000); 
    system("cls");
    }
    for(i=1;i<=6;++i){
    	sj=rand()%30;
    		for(k=1;k<=20;++k){
    			a[i]=k;
    			if(k==sj){
    				system("cls");break;
    			}
    			cout<<setw(2)<<setfill('0')<<a[1]<<" "<<setw(2)<<setfill('0')<<a[2]<<" "<<setw(2)<<setfill('0')<<a[3]<<" "<<setw(2)<<setfill('0')<<a[4]<<" "<<setw(2)<<setfill('0')<<a[5]<<" "<<setw(2)<<setfill('0')<<a[6];
    			Sleep(100);
    			system("cls");
    		}
    	
    }
    for(i=1;i<=6;++i)cout<<setw(2)<<setfill('0')<<a[i]<<" ";
    for(i=1;i<=6;++i){
    	if(a[i]==b[i]){
    		if(d==0){
    			d+=bs;
    		}else{
    			d*=2;
    		}
    	}		
    }
    cout<<endl;
    d*=bs;
    for(i=1;i<=6;++i)cout<<setw(2)<<setfill('0')<<b[i]<<" ";
    cout<<endl;
    cout<<"你得"<<d<<"个G币"<<endl;
    db+=d;
    system("pause");
    system("cls");	
    } 
    int main(){
    kt();
    cs();	
    sxmm();
    system("cls"); 
    while(1){
    if(ll==false){
    	cout<<"开发者模式"<<endl;
    	day=1;
    }
    cout<<"第"<<day<<"天"<<endl;
    cout<<"剩余"<<30-day<<"天"<<endl; 
    cout<<"机付包:"<<db<<"G"<<endl;
    cout<<"扣1,卡牌对战"<<endl;
    cout<<"扣2,彩票"<<endl;
    cout<<"扣3,广告"<<endl;
    cout<<"扣4,买卖"<<endl;
    cout<<"扣5,下一天"<<endl;
    cout<<"扣6,抽奖"<<endl;
    cin>>xz;
    if(xz==1){
    	kp(); 
    }
    if(xz==2){
    hm();	
    }
    if(xz==3){
    	gg();
    }
    if(xz==4){
    	mm();
    }
    if(xz==5){
    	Sleep(1000);
    	system("cls");
    	day++;
    	sxmm();
    	datdh(day);
    }
    if(xz==6){
    	cj();
    }
    if(xz==a6){
    	Sleep(10000);
    	system("cls");
    	cout<<"开发者模式"<<endl;
        Sleep(2000);
        cout<<"机付包到账100000000G"<<endl;
    	db+=100000000;
    	Sleep(2000);
    	ll=false;
    	gs+=1000000;
    	sg+=1000000;
    }
    if(day==20){
    	Sleep(1000);
    	system ("cls");
    	cout<<"游戏结束"<<endl;
    	cout<<"你一共赚了"<<db<<"G"<<endl;
    	return 0;
    }
    system("cls");	
    }
    return 0;
    }
    void hs(){for(i=1;i<=a7;++i){cout<<31-i<<"s";Sleep(1000);system("cls");}cout<<"0s";}
    
    
    
    
    
    
    
  • 通过的题目

  • 最近活动

题目标签

其他
3
排序
3
算法基础
3
语法周赛
2
T1
2
数组问题
1
递推
1
R21
1
R22
1