• C++战火英雄


    1. #include<bits/stdc++.h>
    2. #include<Windows.h>
    3. #include<conio.h>
    4. using namespace std;
    5. int up=100,zd=0,xb=1,q=0;
    6. int gjl[10]={1,2,3,4,5,6,7,8,9,10};
    7. int zx[4]={0,0,-1,1};
    8. int zy[4]={-1,1,0,0};
    9. char mat[101][101];
    10. int x,y,zrs=0,tt=0;
    11. void print(char a[]){
    12. int t=strlen(a);
    13. for(int i=0;i<=t;i++){
    14. cout<<a[i];
    15. Sleep(10);
    16. }
    17. cout<<endl;
    18. }
    19. void start();
    20. int main(){
    21. system("title !战火英雄!-额…………出品");
    22. MessageBox(NULL,"抵制不良游戏,拒绝盗版游戏 注意自我保护,谨防受骗上当 适度游戏益脑,过度游戏伤身 合理安排时间,享受健康生活","温馨提示",MB_OKCANCEL);
    23. cout<<
    24. "一个军事海岛突然遭受黑衣人的袭击,上面的军队抵挡不住,军事海岛最终被黑衣人控制。"<<
    25. "这向人们预示了灾难可能将要到来......"<<endl;
    26. system("pause");
    27. system("cls");
    28. cout<<
    29. "战火英雄1-新的征途"<<endl<<
    30. "版本号"<<endl;
    31. system("pause");
    32. start();
    33. cout<<"再来一次?输入1"<<endl;
    34. int ttttt;
    35. cin>>ttttt;
    36. if(ttttt==1)start();
    37. return 0;
    38. }
    39. void start(){
    40. bool flag=1;
    41. system("cls");
    42. print("地图大小?(n*n)");
    43. int n;
    44. cin>>n;
    45. print("(飞机的呼呼声)");
    46. print("长官:准备跳伞!祝你好运,新兵");
    47. print("落点x,y?");
    48. cout<<"x:";
    49. cin>>x;
    50. cout<<"y:";
    51. cin>>y;
    52. system("pause");
    53. system("cls");
    54. srand(time(NULL));
    55. for(int i=1;i<=n;i++)
    56. for(int j=1;j<=n;j++){
    57. int k=rand()%10+1;
    58. if(k==1)mat[i][j]='.';
    59. else if(k==2)mat[i][j]='H';
    60. else if(k==3)mat[i][j]='X';
    61. else if(k==4)mat[i][j]='P';
    62. else if(k==5)mat[i][j]='D';
    63. else if(k==6)mat[i][j]='.';
    64. else if(k==7)mat[i][j]='.';
    65. else mat[i][j]='.';
    66. }
    67. mat[x][y]='.';
    68. mat[x+1][y]='.';
    69. mat[x-1][y]='.';
    70. mat[x][y+1]='.';
    71. mat[x][y-1]='.';
    72. int bs=0,dp=0;
    73. while(1){
    74. bs++;
    75. if(bs==90||bs==190)cout<<"还有10步缩圈!"<<endl;
    76. if(bs==95||bs==195)cout<<"还有5步缩圈!"<<endl;
    77. if(bs==99||bs==199)cout<<"还有1步缩圈!"<<endl;
    78. if(bs==100){
    79. dp++;
    80. for(int i=1;i<=n;i++)mat[dp][i]='#',mat[n-dp+1][i]='#',mat[i][dp]='#',mat[i][n-dp+1]='#';
    81. }
  • 相关阅读:
    数字电路和模拟电路-2数字电路基础
    mac安装node失败
    【Mysql进阶优化篇02】索引失效的10种情况及原理
    别处拿来的VUE项目 npm run serve报错
    Kafka 消息保留策略及其影响详解
    【D01】Django中实现带进度条的倒计时功能(简易版)
    深度神经网络预测模型,人工神经网络回归分析
    MySQL数据库基础知识(二)
    Pytorch 神经网络搭建步骤
    sqli-labs/Less-54
  • 原文地址:https://blog.csdn.net/m0_71832999/article/details/128159076