#include <iostream>
#include <windows.h>
using namespace std;
char s[100];
int main(int argc, char** argv)
{
int xl1,xl2;
int gj1,gj2;
cout<<“请创造昵称(英文名):”;
cin>>s[10];
Sleep(1000);
cout<<“你好”<<s[10]<<“!”<<endl;
Sleep(1000);
cout<<“请选择战士:”<<endl;
Sleep(1000);
cout<<“1.蔡徐坤 2.陈奕迅 3.中华武将 4.莎士比亚 5.学校老师”<<endl;
Sleep(1000);
cin>>s[10];
if(s[10]==’1′)
{
cout<<“主武器:坤坤篮球”<<endl;
Sleep(1000);
cout<<“血量:100″<<endl;
Sleep(1000);
cout<<“攻击:20″<<endl;
xl1=100;
for(int i=1;i<=30;i++)
{
Sleep(1000);
cout<<“1.去森林”<<endl;
cout<<“2.去草原”<<endl;
cout<<“3.去山洞”<<endl;
cin>>s[10];
if(s[10]=’1′)
{
cout<<“遇见丛林虎”<<endl;
Sleep(1000);
cout<<“危险指数:10″<<endl;
Sleep(1000);
cout<<“打成平手,不分上下”<<endl;
continue;
}
if(s[10]=’2′)
{
cout<<“遇见草原狮”<<endl;
Sleep(1000);
cout<<“危险指数:20″<<endl;
Sleep(1000);
cout<<“打成平手,不分上下!”<<endl;
continue;
}
if(s[10]=’3′)
{
cout<<“遇见美洲豹”<<endl;
Sleep(1000);
cout<<“危险指数:50″<<endl;
Sleep(1000);
cout<<“打成平手,不分上下!”<<endl;
continue;
}
}
}
if(s[10]==’2′)
{
cout<<“主武器:反物质核弹”<<endl;
Sleep(1000);
cout<<“血量:85″<<endl;
Sleep(1000);
cout<<“攻击:70″<<endl;
xl1=85;
for(int i=1;i<=30;i++)
{
Sleep(1000);
cout<<“1.去森林”<<endl;
cout<<“2.去草原”<<endl;
cout<<“3.去山洞”<<endl;
cin>>s[10];
if(s[10]=’1′)
{
cout<<“遇见丛林虎”<<endl;
Sleep(1000);
cout<<“危险指数:10″<<endl;
Sleep(1000);
cout<<“核弹把老虎秒了!”<<endl;
continue;
}
if(s[10]=’2′)
{
cout<<“遇见草原狮”<<endl;
Sleep(1000);
cout<<“危险指数:20″<<endl;
Sleep(1000);
cout<<“核弹把狮子秒了!”<<endl;
continue;
}
if(s[10]=’3′)
{
cout<<“遇见美洲豹”<<endl;
Sleep(1000);
cout<<“危险指数:50″<<endl;
Sleep(1000);
cout<<“核弹把豹子秒了!”<<endl;
continue;
}
}
}
if(s[10]==’3′)
{
cout<<“主武器:青釭剑”<<endl;
Sleep(1000);
cout<<“血量:200″<<endl;
Sleep(1000);
cout<<“攻击:50″<<endl;
xl1=200;
for(int i=1;i<=30;i++)
{
Sleep(1000);
cout<<“1.去森林”<<endl;
cout<<“2.去草原”<<endl;
cout<<“3.去山洞”<<endl;
cin>>s[10];
if(s[10]=’1′)
{
cout<<“遇见丛林虎”<<endl;
Sleep(1000);
cout<<“危险指数:10″<<endl;
Sleep(1000);
cout<<“你开场把老虎砍死了!”<<endl;
continue;
}
if(s[10]=’2′)
{
cout<<“遇见草原狮”<<endl;
Sleep(1000);
cout<<“危险指数:20″<<endl;
Sleep(1000);
cout<<“你开场把狮子砍死了!”<<endl;
continue;
}
if(s[10]=’3′)
{
cout<<“遇见美洲豹”<<endl;
Sleep(1000);
cout<<“危险指数:50″<<endl;
Sleep(1000);
cout<<“你开场把豹子砍死了!”<<endl;
continue;
}
}
}
if(s[10]==’4′)
{
cout<<“主武器:墨镜”<<endl;
Sleep(1000);
cout<<“血量:90″<<endl;
Sleep(1000);
cout<<“攻击:5″<<endl;
xl1=90;
for(int i=1;i<=30;i++)
{
Sleep(1000);
cout<<“1.去森林”<<endl;
cout<<“2.去草原”<<endl;
cout<<“3.去山洞”<<endl;
cin>>s[10];
if(s[10]=’1′)
{
cout<<“遇见丛林虎”<<endl;
Sleep(1000);
cout<<“危险指数:10″<<endl;
Sleep(1000);
cout<<“你被老虎秒了!”<<endl;
return 0;
}
if(s[10]=’2′)
{
cout<<“遇见草原狮”<<endl;
Sleep(1000);
cout<<“危险指数:20″<<endl;
Sleep(1000);
cout<<“你被狮子秒了!”<<endl;
return 0;
}
if(s[10]=’3′)
{
cout<<“遇见美洲豹”<<endl;
Sleep(1000);
cout<<“危险指数:50″<<endl;
Sleep(1000);
cout<<“你被豹子秒了”<<endl;
return 0;
}
}
}
if(s[10]==’5′)
{
cout<<“主武器:戒尺”<<endl;
Sleep(1000);
cout<<“血量:70″<<endl;
Sleep(1000);
cout<<“攻击:10″<<endl;
xl1=70;
for(int i=1;i<=30;i++)
{
Sleep(1000);
cout<<“1.去森林”<<endl;
cout<<“2.去草原”<<endl;
cout<<“3.去山洞”<<endl;
cin>>s[10];
if(s[10]=’1′)
{
cout<<“遇见丛林虎”<<endl;
Sleep(1000);
cout<<“危险指数:10″<<endl;
Sleep(1000);
cout<<“由于戒尺打不过老虎,你死了!”<<endl;
return 0;
}
if(s[10]=’2′)
{
cout<<“遇见草原狮”<<endl;
Sleep(1000);
cout<<“危险指数:20″<<endl;
Sleep(1000);
cout<<“由于戒尺打不过狮子,你死了!”<<endl;
return 0;
}
if(s[10]=’3′)
{
cout<<“遇见美洲豹”<<endl;
Sleep(1000);
cout<<“危险指数:50″<<endl;
Sleep(1000);
cout<<“由于戒尺打不过豹子,你死了!”<<endl;
return 0;
}
}
}
return 0;
}
因为过于简单大家可以按照格式修改