#include<bits/stdc++.h>
#define MAXNUM 100 //最大规模
using namespace std;
/* 变量设置 */
/**************************
* di: 特定棋子横坐标 *
* dj: 特定棋子纵坐标 *
* hi: 棋盘左上角横坐标 *
* hj: 棋盘左上角纵坐标 *
* Tile:棋子序号 *
* Board: 棋盘 *
* MAXNUM: 棋盘最大规模 *
**************************/
int Board[MAXNUM][MAXNUM];
int Tile = 0;
/* 初始化棋盘 */
void Initial(int &size,int &di,int &dj){
/*输入棋盘规模,初始化棋盘*/
cout<<"please input the size of board: "<<endl;
cin>>size;
/*输入初始插入点*/
cout<<"please input the di and dj"<<endl;
cin>>di>>dj;
Board[di][dj] = Tile;
}
/* 显示棋盘结果 */
void Show(int n){
for(int i = 1;i <= n;i++){
for(int j = 1;j <= n;j++)printf("%3d " , Board[i][j]);
cout<<endl;
}
}
/* 棋盘覆盖分治法求解 */
void BoardCov
棋盘覆盖(分治法)
最新推荐文章于 2022-10-24 22:03:13 发布