c++小游戏(包好玩的)!!
2024-07-26 16:58:37
发布于:广东
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"欢迎来到福田CBD牢尸乱斗!!";
cout<<endl;
cout<<"请选择您的老师..."<<endl;
cout<<"1.覃牢尸"<<" "<<"2.宋牢尸"<<" "<<"3.彭思远捞尸"<<endl;
cin>>n;
if(n == 1){
cout<<"恭喜您选择了覃牢尸!"<<endl;
cout<<"接下来您可以选择一个模式!!"<<endl;
}
else if(n == 2){
cout<<"恭喜您选择了宋牢尸!"<<endl;
cout<<"接下来您可以选择一个模式!!"<<endl;
}
else if(n == 3){
std::this_thread::sleep_for(std::chrono::seconds(1));
cout<<"接下来您可以选择一个模式!!"<<endl;
}
int a;
std::this_thread::sleep_for(std::chrono::seconds(1));
cout<<"1.牢尸之王挑战赛"<<endl;
cout<<"2.牢尸抓铜屑(同学)"<<endl;
cout<<"3.牢尸武器商店"<<endl;
cout<<"4.牢尸刷怪笼"<<endl;
cin>>a;
if(a == 1){
for(int i = 0;i<=90;i+=30){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
for(int i = 91;i<=100;i++){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
else if(a == 2){
for(int i = 0;i<=90;i+=30){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
for(int i = 91;i<=100;i++){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
else if(a == 3){
for(int i = 0;i<=90;i+=30){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
for(int i = 91;i<=100;i++){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
else if(a == 4){
for(int i = 0;i<=90;i+=30){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
for(int i = 91;i<=100;i++){
cout<<"正在进入..."<<i<<"%"<<endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
std::this_thread::sleep_for(std::chrono::seconds(2));
cout<<"对不起,无法访问(没做)";
return 0;
}
这里空空如也
有帮助,赞一个