没有合适的资源?快使用搜索试试~ 我知道了~
数据结构课程设计校园导航源程序,该程序能提高景点的查询及各景点最短路线确定等功能。
资源推荐
资源详情
资源评论
#include<iostream >
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define Max 32767
#define NUM 11
typedef struct ArcCell{
int adj; // 相邻接的景点之间的路程
char *info;
}ArcCell; // 定义边的类型
typedef struct VertexType{
int number; // 景点编号
char *sight; // 景点名称
char *description; // 景点描述
}VertexType; // 定义顶点的类型
typedef struct{
VertexType vex[NUM]; // 图中的顶点,即为景点
ArcCell arcs[NUM][NUM]; // 图中的边,即为景点间的距离
int vexnum,arcnum; // 顶点数,边数
}MGraph; // 定义图的类型
MGraph G; // 把图定义为全局变量
int P[NUM][NUM]; // //
long int D[NUM]; // 辅助变量存储最短路径长度
int x[13]={0};
void CreateUDN(int v,int a); // 创建图的函数
void pingmu(); //屏幕输出函数
void introduce();
void ShortestPath(int num); //最短路径函数
void output(int sight1,int sight2); //输出函数
void PrintMGraph();
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define Max 32767
#define NUM 11
typedef struct ArcCell{
int adj; // 相邻接的景点之间的路程
char *info;
}ArcCell; // 定义边的类型
typedef struct VertexType{
int number; // 景点编号
char *sight; // 景点名称
char *description; // 景点描述
}VertexType; // 定义顶点的类型
typedef struct{
VertexType vex[NUM]; // 图中的顶点,即为景点
ArcCell arcs[NUM][NUM]; // 图中的边,即为景点间的距离
int vexnum,arcnum; // 顶点数,边数
}MGraph; // 定义图的类型
MGraph G; // 把图定义为全局变量
int P[NUM][NUM]; // //
long int D[NUM]; // 辅助变量存储最短路径长度
int x[13]={0};
void CreateUDN(int v,int a); // 创建图的函数
void pingmu(); //屏幕输出函数
void introduce();
void ShortestPath(int num); //最短路径函数
void output(int sight1,int sight2); //输出函数
void PrintMGraph();
char Menu(); // 主菜单
void search();
;// 查询景点信息
char SearchMenu(); // 查询子菜单
void HaMiTonian(int); // 哈密尔顿图的遍历
void NextValue(int);
void display(); // 显示遍历结果
void main() // 主函数
{ int v0,v1;
char ck;
system("color 0");
CreateUDN(NUM,11);
do
{
ck=Menu();
switch(ck)
{
case'1':
introduce();
printf("\n\n\t\t\t%-25s\n\n",G.vex[0].description);
getchar();
getchar();
break;
case '2':
system("cls");
pingmu();
printf("\n\n\t\t\t请选择起点景点(1~10):");
scanf("%d",&v0);
printf("\t\t\t请选择终点景点(1~10):");
scanf("%d",&v1);
void search();
;// 查询景点信息
char SearchMenu(); // 查询子菜单
void HaMiTonian(int); // 哈密尔顿图的遍历
void NextValue(int);
void display(); // 显示遍历结果
void main() // 主函数
{ int v0,v1;
char ck;
system("color 0");
CreateUDN(NUM,11);
do
{
ck=Menu();
switch(ck)
{
case'1':
introduce();
printf("\n\n\t\t\t%-25s\n\n",G.vex[0].description);
getchar();
getchar();
break;
case '2':
system("cls");
pingmu();
printf("\n\n\t\t\t请选择起点景点(1~10):");
scanf("%d",&v0);
printf("\t\t\t请选择终点景点(1~10):");
scanf("%d",&v1);
剩余13页未读,继续阅读
资源评论
xc375615140
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功