#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a,zs;
int shiwu=5,shui=5;
int j=7,k=3;
int xy;
int main(){
srand((int)time(0));
cout<<"核弹爆炸的前一秒,你来到了地下安全室......";
Sleep(1010);
system("cls");
zs=rand()%10+41;
for(int i=1;zs>0;i++,zs--)
{
system("cls");
cout<<"第"<<i<<"天"<<endl;
Sleep(1000);
if(shiwu>=1) shiwu--;
else j--;
if(shui>=1) shui--;
else k--;
if(j<=0||k<=0)
{
if(j<=0)
{
cout<<"你被饿死了"<<endl;
Sleep(1000);
}
else
{
cout<<"你被渴死了"<<endl;
Sleep(1000);
}
return 0;
}
else
{
cout<<"食物:"<<shiwu<<endl;
cout<<"水:"<<shui<<endl;
cout<<"请选择:"<<endl;
cout<<"1.上陆地探险"<<endl;
cout<<"2.发送求救信号"<<endl;
cin>>a;
if(a==1)
{
xy=rand()%7+1;
if(xy==1)
{
cout<<"你被核辐射弄死了"<<endl;
return 0;
}
else
{
int s,u;
s=rand()%4;
u=rand()%4;
if(s!=0&&u!=0)
{
shiwu+=s;
shui+=u;
cout<<"你找到了"<<s<<"份食物"<<endl;
Sleep(1050);
cout<<"你找到了"<<u<<"瓶水"<<endl;
Sleep(3000);
}
else if(s!=0)
{
shiwu+=s;
shui+=u;
cout<<"你找到了"<<s<<"份食物"<<endl;
Sleep(1050);
cout<<"你没找到水"<<endl;
Sleep(3000);
}
else if(u!=0)
{
shiwu+=s;
shui+=u;
cout<<"你没有找到食物"<<endl;
Sleep(1050);
cout<<"你找到了"<<u<<"瓶水"<<endl;
Sleep(3000);
}
else
{
cout<<"什么也没找到"<<endl;
Sleep(3000);
}
}
}
else if(a==2)
{
xy=rand()%3+1;
if(xy<=2)
{
cout<<"求救信号似乎没有奏效"<<endl;
Sleep(3000);
}
else
{
int zx=rand()%2+1;
cout<<"求救信号似乎奏效了"<<endl;
zs-=zx;
Sleep(3000);
}
}
else return 0;
}
}
cout<<"你被救援队发现,救了下来"<<endl;
cout<<"胜利";
Sleep(2005);
return 0;
}