当前位置: 首页 > news >正文

做二手货的网站有哪些为什么自己做的网站打开是乱码

做二手货的网站有哪些,为什么自己做的网站打开是乱码,注册网站需要注意什么,上海市招工网前言 两个数组#xff0c;一个用来显示在控制台上#xff0c;一个用来存放雷 两个数组的实际大小为11 * 11 #xff0c;而为了方便排查雷的个数#xff0c;实际使用范围是9 * 9 test.c #includemine_sweeping.hvoid game() {// 存放雷char mine[ROWS][COL…前言 两个数组一个用来显示在控制台上一个用来存放雷 两个数组的实际大小为11 * 11 而为了方便排查雷的个数实际使用范围是9 * 9  test.c  #includemine_sweeping.hvoid game() {// 存放雷char mine[ROWS][COLS];// 展示char show[ROWS][COLS];// 初始化棋盘InitBoard(mine, ROWS, COLS, 0);InitBoard(show, ROWS, COLS, *);// 打印棋盘DisplayBoard(show, ROW, COL);// 布置雷SetMine(mine, ROW, COL);// 排查雷FindMine(mine, show, ROW, COL); }int main() {int input 0;// 随机数生成器srand((unsigned int)time(NULL));do{menu();printf(请输入);scanf(%d, input);if (input 1){game();}else if (input 0){printf(退出游戏\n);}else{printf(输入错误请重新输入\n);}} while (input);return 0; }game.h #includestdio.h #includestdlib.h #includetime.h#define ROW 9 #define COL 9 #define ROWS ROW 2 #define COLS COL 2 #define MINE ((ROW COL) / 2)// 打印菜单 void menu();// 初始化棋盘 void InitBoard(char board[ROWS][COLS], int rows, int cols, char str);// 打印棋盘 void DisplayBoard(char board[ROWS][COLS], int row, int col);// 布置雷 void SetMine(char board[ROWS][COLS], int row, int col);// 排查雷 void FindMine(char mine[ROWS][COLS], char show[ROWS][COLS], int row, int col); game.c #includemine_sweeping.h// 打印菜单 void menu() {printf(*******************************************\n);printf(***** 1.play 0.next *****\n);printf(*******************************************\n); }// 初始化棋盘 void InitBoard(char board[ROWS][COLS], int rows, int cols, char set) {for (int i 0; i rows; i){for (int j 0; j cols; j){board[i][j] set;}} }// 打印棋盘 void DisplayBoard(char board[ROWS][COLS], int row, int col) {printf(\n);//printf(--------------mine game--------------\n);// 打印横坐标for (int i 1; i row; i){printf( %d , i);printf( );}printf(\n);for (int i 1; i row; i){for (int j 1; j col; j){// 打印每一行printf( %c , board[i][j]);if (j row){printf(|);}}// 打印纵坐标printf( %d\n, i);// 打印分割线if (i col){for (int k 0; k row; k){printf(---);if (k row - 1){printf(|);}}printf(\n);}}printf(\n); }// 布置雷 void SetMine(char board[ROWS][COLS], int row, int col) {// 雷的个数int mine MINE;while (mine){int x rand() % row 1;int y rand() % col 1;if (board[x][y] 0){board[x][y] 1;mine--;}} }// 统计雷的个数 int GetMineCount(char mine[ROWS][COLS], int x, int y) { // return (mine[x - 1][y] mine[x - 1][y - 1] mine[x][y - 1] mine[x 1][y - 1] // mine[x 1][y] mine[x 1][y 1] mine[x][y 1] mine[x - 1][y 1] - 8 * 0);int count 0;if (mine[x - 1][y] 1)count;if (mine[x - 1][y - 1] 1)count;if (mine[x][y - 1] 1)count;if (mine[x 1][y - 1] 1)count;if (mine[x 1][y] 1)count;if (mine[x 1][y 1] 1)count;if (mine[x][y 1] 1)count;if (mine[x - 1][y 1] 1)count;return count; }// 一次展开一片 void UnfoldSlice(char mine[ROWS][COLS], char show[ROWS][COLS], int x, int y) {if (x 1 x ROW y 1 y COL){int count GetMineCount(mine, x, y);if (count 0 mine[x][y] ! *){show[x][y] count 0;mine[x][y] *;UnfoldSlice(mine, show, x - 1, y);UnfoldSlice(mine, show, x - 1, y - 1);UnfoldSlice(mine, show, x, y - 1);UnfoldSlice(mine, show, x 1, y - 1);UnfoldSlice(mine, show, x 1, y);UnfoldSlice(mine, show, x 1, y 1);UnfoldSlice(mine, show, x, y 1);UnfoldSlice(mine, show, x - 1, y 1);}if (count ! 0){show[x][y] count 0;return;}}else{return;}}int IsWin(char show[ROWS][COLS], int row, int col) {int count 0;for (int i 1; i row; i){for (int j 1; j col; j){if (show[i][j] *)count;}}return count;}// 排查雷 void FindMine(char mine[ROWS][COLS], char show[ROWS][COLS], int row, int col) {int x 0;int y 0;int MineCount MINE;while (IsWin(show, row, col) MineCount){printf(请输入要排查雷的坐标用空格隔开);scanf(%d %d, x, y);if (x 1 x row y 1 y col){if (mine[x][y] 1){printf(很遗憾你被炸死了游戏结束\n);DisplayBoard(mine, ROW, COL);break;}else{// 一次展开一片UnfoldSlice(mine, show, x, y);DisplayBoard(show, ROW, COL);}}else{printf(坐标非法请重新输入\n);}}if (IsWin(show, row, col) MINE){printf(恭喜你排雷成功\n);DisplayBoard(mine, ROW, COL);} }
http://www.hkea.cn/news/14287643/

相关文章:

  • 北京朝阳网站嘉兴房产网站建设
  • 小型网站维护商田科技网站
  • 网站建设 每年收费个人dw网页设计
  • 鄞州区建设局网站360未经证实的网站如何做
  • 山西两学一做登录网站网站首页大图的尺寸
  • 网站漏洞微信服务号开发方案
  • 找网站建设客户百度搜索风云榜小说
  • 郑州网站开发douyanet施工企业高级工程师土建答辩
  • wordpress整站备份网页素材有哪几大类
  • 如何设计营销 网站建设wordpress首页显示摘要插件
  • wordpress qiniu-uploader 使用2020站群seo系统
  • 网页模板快速建站工具网站运营管理主要内容
  • 新乡手机网站建设官网怎样管理网站
  • 邯郸网站建设外包自己做网站能赚到广告费吗
  • wordpress企业站主题下载地址网站开发流程甘特图
  • 无锡网站建设哪家公司比较好苏州建设项目备案网站
  • 培训型网站建设wordpress主页不显示图片
  • 敦煌做网站 条件宿迁新站seo
  • 凤岗建设网站淘客app
  • 怎么注册晋江网站做的从网页上直接下载视频
  • 建个网站的流程寮步建设网站
  • 做外贸的免费网站赤壁市药监局网站建设方案
  • 入侵织梦网站后台平原县网站seo优化排名
  • 济南能源建设网站中国核工业华兴建设有限公司
  • 温州网站建设服务电子商务网络公司做网站用什么格式做好
  • 网盘怎么做电影网站衡水做网站报价
  • asp开源企业网站教程金华网络公司网站建设
  • pos机网站建设方案电商网站建设懂你所需
  • 高效网站建设咨询郑州上市企业网站建设
  • 网站支付怎么做的云南昆明百度推广公司