#include<bits/stdc++.h>
using namespace std;
int main(){
	int b,c,d,e;
	int f[30],a[30];
	system("color fa");
	srand(time(0));
	b=rand()%50+1;
	c=rand()%50+1;
	d=rand()%50+1;
	e=rand()%50+1;
	cout<<"**数字炸弹**"<<endl<<"规则:"<<endl<<"1.不能输入比50大的数"<<endl<<"2.不能输入比1小的数"<<endl<<"3.不能输入字母"; 
	for(int i=0;i<30;i++){
		cin>>a[i];
		if(a[i]<1||50<a[i]||a[i]!=(int)a[i]){
			system("color c4");
			cout<<"你死了";
			return 0; 
		}
		f[i]=a[i];
//		for(int j=0;j<30;j++){
//			if(f[j]==a[i]&&f[j]!=i){
//				cout<<"不能输入同样的数"<<a[i]<<"!";
//				i--;
//			}
//		}
		if(a[i]==b){
			cout<<"你抽到炸弹卡了!"<<endl;
			system("color ce");
			system("pause");
			system("cls");
			i-=2;
		}
		if(a[i]==c){
			cout<<"恭喜你抽到了神秘道具!"<<endl;
			system("color de");
			system("pause");
			system("cls");
			i+=5;
		}
		if(a[i]==d){
			system("color c4");
			cout<<"你抽到核弹死了。"<<endl;
			system("pause");
			system("cls");
			cout<<"神秘道具是:"<<c<<endl;
			cout<<"炸弹是:"<<b<<endl;
			cout<<"核弹是:"<<d<<endl;
			cout<<"万能卡是:"<<e<<endl;
			return 0;
		}
		if(a[i]==e){
			cout<<"你抽到万能卡赢了!"<<endl;
			system("color e1");
			system("pause");
			system("cls");
			break;
		}
		cout<<"你没死!"<<endl;
	}
	cout<<"你赢了!"<<endl;
	system("pause");
	system("cls");
	cout<<"神秘道具是:"<<c<<endl;
	cout<<"炸弹是:"<<b<<endl;
	cout<<"核弹是:"<<d<<endl;
	cout<<"万能卡是:"<<e<<endl;
	return 0;
}


5 条评论

  • 1