简单搜索
直接代码:
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<queue>
using namespace std;
char a,c;
int e,f;
int dx[8] = {-2, -2, -1, -1, 1, 1, 2, 2};
int dy[8] = {-1, 1, -2, 2, -2, 2, -1, 1};
int qq[9][9];
struct node
{
int q,w,num;
};
node b,d;
queue<node> q;
void bfs()
{
int i;
while(!q.empty())
{
node temp=q.front();
q.pop();
if(temp.q==d.q&&temp.w==d.w)
{
printf("......
阅读全文