上传者: Crazying111
|
上传时间: 2021-11-05 23:31:50
|
文件大小: 2KB
|
文件类型: -
把一个迷宫用图的邻接表表示。再来通过图的遍历求最长路径。c语言版
#include
const a[10][10]={
{0,0,0,0,0,0,0,0,0,0},
{0,0,1,1,0,0,0,0,1,0},
{0,1,1,0,0,1,1,1,1,0},
{0,0,1,0,1,1,0,1,1,0},
{0,0,0,0,0,1,1,1,1,0},
{0,0,1,0,0,0,0,0,1,0},
{0,1,1,1,1,0,0,0,1,0},
{0,1,1,1,1,0,0,0,1,0},
{0,0,0,0,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0},
};
const v[4]={0,1,0,-1};
const h[4]={1,0,-1,0};
short f[10][10]={0};
short mark[10][10]={0};