八数码.h

来自「多媒体课内实验:用C语言实现的八数码问题。」· C头文件 代码 · 共 30 行

H
30
字号
#include <iostream>
#include <queue>
#include <vector>
using namespace std;

typedef struct PathNode
{
	friend bool operator < (PathNode n1, PathNode n2)
	{
		return n1.f<n2.f;
	}
	int a[3][3];
	int g;
	int h;
	int f;
	int how;
	int s_row, s_col;
	struct PathNode *next;
	struct PathNode *parent;
	
}PathNode;


priority_queue<PathNode> open;

priority_queue<PathNode> closed;


PathNode src,end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?