抽奖(DEV-C++)

#include<bits/stdc++.h>
using namespace std;
int a2,b2;
string a,b;
int c,je=50; 
void cj(int a3,int b3){
	b3=rand()%10+1;
	cout<<"请稍等......"<<endl;
	cout<<"请输入一个1~10的数:"<<endl;
	cin>>a3;
	if(a3==b3){
		je+=20;
	}else{
		if(a3!=10){
			if(a2>10){
				cout<<"对不起,您的输入有错,处罚5元,下次别搞系统了!!!";
				je-=5;
			}else{
				je-=5;
			}
		}
	}
	system("cls");
}
int main(){
	system("pause");
	for(int i=0;i<=100;i++){
		cout<<"加载进度"<<"("<<i<<"/100)" ;
		if(i!=100){
			system("cls");
		}
		else{
			cout<<endl<<"目标完成,加载完毕";
		}
	}
	cout<<endl;
    system("cls");
    cout<<"hi,欢迎来到抽奖模拟器"<<endl;
	system("pause");
	system("cls");
	for(;;){
		cout<<"您的金额:"<<je<<endl
			<<"您要做什么"<<endl
			<<"1.抽奖 2.退出"<<endl;
		cin>>c;
		if(c==1){
			cj(a2,b2);
		}if(c==2){
			cout<<"欢迎下次再来!";
			return 0;
		}
		if(je==0||je<0){
			cout<<"没钱了,重来吧!";
			return 0;
		}	
	}
    return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值