-
个人简介
塔防游戏
#include<bits/stdc++.h>
using namespace std;int main() { ** int a,b,sum=0;** ** cin>>a>>b;** ** if(a+b34655)** ** { ** cout<<"加载中..."<<endl; ** cout<<"进度条:";** ** for(int j=1;j<=10;j++)** ** { ** cout<<"..."; ** _sleep(1*1000);** ** } ** cout<<"你是否想杀死日本人?1为投杀"<<endl<<"你们有几人?"<<endl; ** int n;** ** cin>>n;** ** cout<<"你是否想杀死日本人?1为投杀"<<endl;** ** for(int i=1;i<=n;i++)** ** { ** cout<<"你是否想杀死日本人?1为投杀"<<endl; ** int c;** ** cin>>c;** ** if(c+12)** ** { ** cout<<"好!"<<endl; ** sum++;** ** c=c-1;** ** cout<<sum;** ** } ** else{ ** cout<<"国贼!";** ** } ** }
**}**
**return** **0**;}
#include<bits/stdc++.h>//此代码还没写完,禁抄; using namespace std;
int main() { cout<<"欢迎进入生化危机:请等待加载..."<<endl; for(int i=1;i<=15;i++) { _sleep(0.51000); cout<<"$"; } cout<<endl; cout<<"开局你在一个小房子里,你有7发子弹和5个食物。"<<endl; _sleep(0.81000); int zd=7,sw=5; cout<<"接下来你要干什么?"<<endl; _sleep(0.81000); cout<<"1,呆在原地。"<<endl; _sleep(0.81000); cout<<"2,出去看看。"<<endl; _sleep(0.81000); cout<<"3,吃一个食物。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+1==2) { _sleep(0.81000); cout<<"你发现门被丧尸撞得开始弯曲。"<<endl; _sleep(0.81000); cout<<"你是否开枪击毙进来的丧尸?"<<endl; _sleep(0.81000); cout<<"1,开枪。"<<endl; _sleep(0.81000); cout<<"2,不开。"<<endl;
int b; cin>>b; if(b+1==2) { _sleep(0.8*1000); cout<<"你杀死了丧尸,用了1颗子弹。"<<endl; zd=zd-1; _sleep(0.8*1000); cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.8*1000); cout<<"你现在要干嘛?"<<endl; _sleep(0.8*1000); } else { cout<<"你死了!"; return 0; } } return 0;}
#include<bits/stdc++.h>//此代码还没写完,禁抄; using namespace std;
int main() { cout<<"欢迎进入生化危机:请等待加载..."<<endl; for(int i=1;i<=15;i++) { _sleep(0.51000); cout<<"$"; } cout<<endl; cout<<"开局你在一个小房子里,你有7发子弹和5个食物。"<<endl; _sleep(0.81000); int zd=7,sw=5; cout<<"接下来你要干什么?"<<endl; _sleep(0.81000); cout<<"1,呆在原地。"<<endl; _sleep(0.81000); cout<<"2,出去看看。"<<endl; _sleep(0.81000); cout<<"3,吃一个食物。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+1==2) { _sleep(0.81000); cout<<"你发现门被丧尸撞得开始弯曲。"<<endl; _sleep(0.81000); cout<<"你是否开枪击毙进来的丧尸?"<<endl; _sleep(0.81000); cout<<"1,开枪。"<<endl; _sleep(0.81000); cout<<"2,不开。"<<endl;
int b; cin>>b; if(b+1==2) { _sleep(0.81000); cout<<"你杀死了丧尸,用了1颗子弹。"<<endl; zd=zd-1; _sleep(0.81000); cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.81000); cout<<"你现在要干嘛?"<<endl; _sleep(0.81000); } else { cout<<"你死了!"; return 0; }
} return 0;
} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include <iostream> #include<bits/stdc++.h> #include <cstdlib> #include <chrono> #include <thread> #include <conio.h> // Windows 专用:_kbhit() 和 _getch() using namespace std; // 跨平台清空控制台 void clearConsole() { #ifdef _WIN32 system("cls"); #else system("clear"); #endif }
int main() { std::cout<<"\033[34m蓝色字体\033[0m"<<std::endl; cout<<"你已进入狼牙山五壮士抗日游戏:"<<endl; _sleep(0.81000); cout<<"加载中..."<<endl; for(int i=1;i<=15;i++) { cout<<"|"; _sleep(0.81000); } cout<<endl; cout<<"请选择你要扮演的英雄:"<<endl; _sleep(0.81000); cout<<"1,马宝玉。"<<endl; _sleep(0.81000); cout<<"2,葛振林。"<<endl; _sleep(0.81000); cout<<"3,宋学义。"<<endl; _sleep(0.81000); cout<<"4,胡福才。"<<endl; _sleep(0.81000); cout<<"5,胡德林。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+12) { cout<<"0,扔石头"<<endl; _sleep(0.81000); cout<<"1,跳崖"<<endl; _sleep(0.81000); } if(a+13) { cout<<"0,开枪"<<endl; _sleep(0.81000); cout<<"1,大吼"<<endl; _sleep(0.81000); } if(a+14) { cout<<"0,扔炸弹"<<endl; _sleep(0.81000); cout<<"1,轮圈"<<endl; _sleep(0.81000); } if(a+15) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } if(a+1==5) { cout<<"0,瞄准"<<endl; _sleep(0.81000); cout<<"1,绷脸"<<endl; _sleep(0.81000); } // 初始化字符位置(控制台坐标系:左上角为 (0,0)) int x = 10; // 水平位置(列) int y = 5; // 垂直位置(行) const int maxX = 40; // 水平移动边界 const int maxY = 15; // 垂直移动边界
while (true) { // 1. 检测并处理按键(无缓冲,按键即响应) if (_kbhit()) { // 判断是否有按键按下 switch (_getch()) { // 读取按下的键 case 'w': case 'W': // 上移(y减小,因为控制台从上往下是y正方向) if (y > 0) y--; break; case 's': case 'S': // 下移(y增大) if (y < maxY) y++; break; case 'a': case 'A': // 左移(x减小) if (x > 0) x--; break; case 'd': case 'D': // 右移(x增大) if (x < maxX) x++; break; case 27: // ESC 键的 ASCII 码是 27,用于退出程序 return 0; } } // 2. 清空控制台,重绘当前帧 clearConsole(); // 3. 绘制垂直位置:输出 y 行空行,将光标定位到第 y 行 for (int i = 0; i < y; ++i) { std::cout << std::endl; } // 4. 绘制水平位置:输出 x 个空格,再输出字符 for (int i = 0; i < x; ++i) { std::cout << " "; } std::cout << "★" << std::endl; // 5. 控制刷新速度(避免画面闪烁,可调整延时) }int b; cin>>b;
return 0;} #include<bits/stdc++.h>//此代码还没写完,禁抄; using namespace std;
int main() { cout<<"欢迎进入生化危机:请等待加载..."<<endl; for(int i=1;i<=15;i++) { _sleep(0.51000); cout<<"$"; } cout<<endl; cout<<"开局你在一个小房子里,你有7发子弹和5个食物。"<<endl; _sleep(0.81000); int zd=7,sw=5; cout<<"接下来你要干什么?"<<endl; _sleep(0.81000); cout<<"1,呆在原地。"<<endl; _sleep(0.81000); cout<<"2,出去看看。"<<endl; _sleep(0.81000); cout<<"3,吃一个食物。"<<endl; _sleep(0.81000); int a; cin>>a; if(a+1==2) { _sleep(0.81000); cout<<"你发现门被丧尸撞得开始弯曲。"<<endl; _sleep(0.81000); cout<<"你是否开枪击毙进来的丧尸?"<<endl; _sleep(0.81000); cout<<"1,开枪。"<<endl; _sleep(0.81000); cout<<"2,不开。"<<endl;
int b; cin>>b; if(b+1==2) { _sleep(0.8*1000); cout<<"你杀死了丧尸,用了1颗子弹。"<<endl; zd=zd-1; _sleep(0.8*1000); cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.8*1000); cout<<"你现在要干嘛?"<<endl; _sleep(0.8*1000); cout<<"1,吃1个食物 2,自杀"<<endl; _sleep(0.8*1000); int c; cin>>c; if(c==1) { _sleep(0.8*1000); cout<<"食物-1"<<endl; sw=sw-1; _sleep(0.8*1000); cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.8*1000); cout<<"你很快被饿死了"; return 0; } else { cout<<"死"; return 0; } } else { cout<<"你死了!"; return 0; } } else if(a==2) { _sleep(0.8*1000); cout<<"你突然想起附近有1超市"<<endl; _sleep(0.8*1000); cout<<"1,去 2,不去"<<endl; _sleep(0.8*1000); int d; cin>>d; if(d==2) { _sleep(0.8*1000); cout<<"你被杀了"<<endl; return 0; } else{ cout<<"你路遇丧尸,消耗子弹1"<<endl; _sleep(0.8*1000); zd=zd-1; cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.8*1000); cout<<"你来到超市,面包+2"<<endl; _sleep(0.8*1000); sw=sw+2; cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; _sleep(0.8*1000); cout<<"丧尸大量出现了"<<endl; _sleep(0.8*1000); cout<<"1,逃,没有物资,节约子弹 2,守,有物资,浪费子弹"<<endl; _sleep(0.8*1000); int e; cin>>e; if(e==2) { if(zd>=4) { cout<<"浪费4子弹"<<endl; zd=zd-4; _sleep(0.8*1000); cout<<"获得10086子弹"<<endl; _sleep(0.8*1000); zd=zd+10086; cout<<"子弹:"<<zd<<"食物:"<<sw<<endl; } else{ cout<<"你死了!"; return 0; } } } } return 0; } -
最近活动
- 华二五年级作业2 作业
- 英才班作业3 作业
- 英才班601作业1 作业
- 英才班作业2 作业
- 英才班602作业1 作业
- 五年级3月10语言基础赛 IOI
- 多组数据测试 作业
- 循环结构设计案例 作业
- 9月29日作业3 作业
- 9月28作业1 作业
- 信达四年级暑期班4 作业
- 信达四年级暑期班3 作业
- 信达四年级暑期班2 作业
- 信达四年级暑期班1 作业
- 信达四年级信奥作业8 作业
- 信达四年级信奥作业7 作业
- 信达四年级信奥作业6 作业
- 信达四年级信奥作业5 作业
- 循环作业2 作业
- 信达四年级信奥作业4 作业
- 循环作业1 作业
- 信达四年级信奥作业3 作业
- 周六下午作业8 作业
- 信达四年级信奥作业1 作业
- 周六下午作业7 作业