diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b6713bb..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.m linguist-language=C diff --git a/1.png b/1.png deleted file mode 100644 index edad40e..0000000 Binary files a/1.png and /dev/null differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 68fb301..0fb0b53 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# DS-DS-curriculum-design +# DS-curriculum-design +This is my course design of data structure. I made a tour guide consultation system based on C language, including Floyd algorithm, depth first traversal and greedy algorithm diff --git a/comment.txt b/comment.txt deleted file mode 100644 index a85351b..0000000 --- a/comment.txt +++ /dev/null @@ -1,14 +0,0 @@ - 留言人:czq 留言时间:Wed Jun 23 20:51:02 2021 -留言内容: 故宫很好玩 - 留言人:czq 留言时间:Wed Jun 23 20:51:18 2021 -留言内容: 故宫针不戳 - 留言人:czq 留言时间:Thu Jun 24 21:00:43 2021 -留言内容: 故宫666 - 留言人:匿名 留言时间:Thu Jun 24 21:07:49 2021 -留言内容: 故宫真好玩123 - 留言人:匿名 留言时间:Fri Jun 25 00:14:03 2021 -留言内容: ff - 留言人:czq 留言时间:Fri Jun 25 09:29:20 2021 -留言内容: 故宫 - 留言人:czq 留言时间:Fri Jun 25 09:29:55 2021 -留言内容: dasda diff --git a/edge.txt b/edge.txt deleted file mode 100644 index 30cad35..0000000 --- a/edge.txt +++ /dev/null @@ -1,12 +0,0 @@ - -1 2 150 -2 3 300 -2 4 200 -3 7 250 -4 6 400 -5 8 450 -5 11 300 -6 9 200 -6 10 600 -7 8 330 -9 10 230 diff --git a/main.cpp b/main.cpp deleted file mode 100644 index e259aa4..0000000 --- a/main.cpp +++ /dev/null @@ -1,500 +0,0 @@ -#include -#include -#include -#include - -#define M 15 // 故宫景点数量 -#define INF 10000 //int最大值 - -/*数据类型*/ -typedef struct -{ - int num; //景点编号 - char name[20]; //景点名称 - char introduction[300]; //景点介绍 -} Scenic; - -typedef struct -{ - Scenic spots[M]; - int edges[M][M]; - int nodes_num,edges_Num; //总结点数,总边数 -} Graph; -/*数据类型 End*/ - - -/**************************************************函数定义表*************************************************************************/ -void get_graph(Graph *g); //创建地图 -void get_edge(Graph *g); //创建地图权值 -int check(int ch); //判断景点编号是否输入错误 -void search(Graph *g); //查看景点信息 -void comment(); //游客评论 -void view_comment(); //游客查看评论 -void short_path(Graph *g); //球所有景点之间的最短路径长度及其路径 -void print_short_path(Graph *g); //打印最短路径 -void print_all_path(Graph *g); //输出所有路径 -void dfs_all_path(Graph *g, int start, int end); //利用DFS求全路径 -void best_path(Graph *g); //最佳路径 -void floyd_print(Graph *g, int start, int end); ///*递归实现打印两点间的最短路径(不包括起始点)*/ -void put_map(); //输出故宫轮廓图 -int put_menu(); //输出主菜单 -void exit_system(); //系统退出界面 -int main(); //主函数功能实现 -/********************************************************************************************************************************/ - -int check(int ch) -{ - if (ch < 0 || ch >= 12) - { - printf("\n"); - printf("您的输入有误,请输入1~11之间的数字!\n"); - return 0; - } - return 1; -} - -void get_graph(Graph *g) -{ - int ta, tb, tmp; //临时变量 - FILE *rf; - rf = fopen("./map.txt", "r"); //文件读取 - if (!rf) - { - printf("ERROR!\n"); - return; - } //如果文件读取失败,返回error! - else if (rf) - { - fscanf(rf, "%d %d", &g->nodes_num, &g->edges_Num); //文件读取总结点数和总边数 - for (int i = 1; i <= g->nodes_num; i++) - { - //读取文件景点编号,景点名称,景点简介 - fscanf(rf, "%d %s %s", &g->spots[i].num, g->spots[i].name, g->spots[i].introduction); - } - //地图初始化:除了自己,其他点都是不可达 - for (int i = 0; i <= g->nodes_num; i++) - { - for (int j = 0; j <= g->nodes_num; j++) - { - if (i == j) - g->edges[i][j] = 0; - else - g->edges[i][j] = INF; - } - } - get_edge(g); - fclose(rf); //文件关闭 - } -} -void get_edge(Graph *g) -{ - int ta, tb, tmp; //临时变量 - FILE *rf; - rf = fopen("./edge.txt", "r"); //文件读取 - //得到边信息 - for (int i = 1; i <= g->edges_Num; i++) - { - fscanf(rf, "%d %d %d", &ta, &tb, &tmp); - //printf("%d %d %d\n",ta,tb,tmp); - g->edges[ta][tb] = g->edges[tb][ta] = tmp; - } - fclose(rf); //文件关闭 -} -void search(Graph *g) -{ - int number; //编号 - while (true) - { - put_map(); - printf("请问您想查看哪个景点(请输入景点编号,输入0结束):"); - scanf("%d", &number); - system("cls"); //清空屏幕 - if (check(number)) - { - if (number == 0) - break; - printf("\n景点编号:%d\n", g->spots[number].num); - printf("\n景点名称:%s\n", g->spots[number].name); - printf("\n景点介绍:%s\n", g->spots[number].introduction); - printf("\n"); - } - } -} - -void comment() -{ - char com[250]; - char name[30]; - int flag; //判断是否匿名 - FILE *rf; - rf = fopen("./comment.txt", "a"); - printf(" 是否匿名(输入0匿名,输入1不匿名):"); - scanf("%d", &flag); - while (flag != 1 && flag != 0) - { - printf(" 输入错误,请重新输入:\n"); - } - if (flag) - { - printf(" 请输入您的姓名:"); - scanf("%s", name); - } - - printf(" 请输入你的留言:"); - scanf("%s", com); - printf("\n"); - time_t t; - struct tm *Time; - t = time(NULL); - Time = localtime(&t); //获取本地时间 - if (flag) - { - fprintf(rf, " 留言人:%s 留言时间:%s留言内容: %s\n", name, asctime(Time), com); - } - else - { - fprintf(rf, " 留言人:匿名 留言时间:%s留言内容: %s\n", asctime(Time), com); - } - - printf(" 感谢您的留言!\n"); - fclose(rf); -} -void view_comment() -{ - char check[1024]; - FILE *rf; - rf = fopen("./comment.txt", "r"); - - printf(" 以下为留言内容:\n"); - printf("\n"); - while (fgets(check, 1024, rf) != NULL) - { - printf("\t %s\n", check); - } - printf("\n"); - fclose(rf); -} - -int path_stack[M]; //路径栈 -int top; -int count; //栈顶位置,路径数 -int visited[M]; //判断是否已经经过 -void dfs_all_path(Graph *g, int start, int end) -{ - int dis = 0; //总距离 - path_stack[top] = start; //将起点入栈 - top++; - visited[start] = 1; //表示该点已经访问过 - for (int i = 1; i <= g->nodes_num; i++) //遍历与这个结点相邻的结点 - { - if (g->edges[start][i] > 0 && g->edges[start][i] != INF && !visited[i]) //如果与i不是自己并且这个点有可达路径并且未被访问过 - { - if (i == end) //如果已经到达目的地 - { - printf(" 第%d条道路:", count++); //将该路径输出 - for (int j = 0; j < top; j++) - { - printf("%s->", g->spots[path_stack[j]].name); //输出该景点 - if (j < top - 1) - dis = dis + g->edges[path_stack[j]][path_stack[j + 1]]; - } - dis = dis + g->edges[path_stack[top - 1]][end]; //计算最后一个边长1 - printf("%s\n", g->spots[end].name); - printf(" 总长度为: %dm\n\n", dis); - } - else //如果还未达到 - { - dfs_all_path(g, i, end); //递归遍历 - top--; //出栈 - visited[i] = 0; //释放该节点 - } - } - } -} - -void print_all_path(Graph *g) -{ - int flag = 0; - int start; //起点 - int end; //终点 - memset(path_stack, 0, sizeof(path_stack)); //路径栈初始化 - memset(visited, 0, sizeof(visited)); //标记数组初始化 - top = 0; //初始化栈顶 - count = 1; //初始化路径条数 - while (true) - { - printf("\n"); - printf(" 请输入起点编号:"); - scanf("%d", &start); - if (check(start)) - { - flag = 1; - if (1 == flag) - break; - } - } - flag = 0; //flag重新置0 - while (true) - { - printf("\n"); - printf(" 请输入终点编号:"); - scanf("%d", &end); - if (check(end)) - { - flag = 1; - if (1 == flag) - break; - } - } - printf("\n"); - dfs_all_path(g, start, end); - printf("\n"); -} - -/*Floyd算法求两景点间的一条最短的路径*/ -int distances[M][M]; //距离向量 -int path[M][M]; //路径向量 -void short_path(Graph *g) -{ - for (int i = 1; i <= g->nodes_num; i++) //初始化距离向量矩阵与路径向量矩阵 - for (int j = 1; j <= g->nodes_num; j++) - { - distances[i][j] = g->edges[i][j]; - if (i != j && distances[i][j] != INF) - path[i][j] = i; //表示如果i和j相邻,i到j需要经过i - else - path[i][j] = -1; //否则用 -1代表当前两点不可达 - } - - for (int k = 1; k <= g->nodes_num; k++) //递推求解每两景点的最短路径 - for (int i = 1; i <= g->nodes_num; i++) - for (int j = 1; j <= g->nodes_num; j++) //更新distances[i][j]的值 - if (distances[i][j] > (distances[i][k] + distances[k][j])) - { - //如果发现引入k点可以使得路径更短 - distances[i][j] = distances[i][k] + distances[k][j]; //更新最短路径长度 - path[i][j] = k; // 更新最短路径上的经结点 - } -} -/*递归实现打印两点间的最短路径(不包括起始点)*/ -void floyd_print(Graph *g, int start, int end) -{ - //递归出口:如果两点相邻或者两点不可达,结束递归 - if (path[start][end] == -1 || path[start][end] == end || path[start][end] == start) - return; - else - { - floyd_print(g, start, path[start][end]); //将中间点作为终点继续打印路径 - printf("%s->", g->spots[path[start][end]].name); //打印中间景点名字 - floyd_print(g, path[start][end], end); //将中间点作为起点继续打印路径 - } -} - -/*输出并打印两点间的最短路径*/ -void print_short_path(Graph *g) -{ - int start, end; //起点编号,终点编号 - do - { - printf(" 请输入起点编号:"); - scanf("%d", &start); - } - while (!check(start)); - do - { - printf(" 请输入终点编号:"); - scanf("%d", &end); - } - while (!check(end)); - printf(" %s到%s的最短距离是:%dm\n", g->spots[start].name, g->spots[end].name, distances[start][end]); - printf(" 最佳游览路线:"); - printf("%s->", g->spots[start].name); //输出路径上的起点 - floyd_print(g, start, end); //输出路径上的中间点 - printf("%s\n", g->spots[end].name); //输出路径上的终点 -} - -/*多景点间求最佳路径*/ -void best_path(Graph *g) -{ - int v_num[M] = {0}, count = 1; //记录用户输入的编号信息 - int dis = 0; //统计全程路径总长 - printf(" 请输入你要游览的第%d个景点的编号(输入0结束输入):", count); - scanf("%d", &v_num[count]); - while (v_num[count] != 0 && count <= 11) - { - while (!check(v_num[count])) - { - printf(" 请输入你要游览的第%d个景点编号:", count); - scanf("%d", &v_num[count]); - } - if (v_num[count] == 0) - break; - printf(" 请输入你要游览的第%d个景点编号:", ++count); - scanf("%d", &v_num[count]); - } - printf(" 已为您挑选最佳访问路径:"); - for (int i = 1; v_num[i] > 0 && v_num[i + 1] > 0; i++) - { - //遍历所有输入的景点 - printf("%s->", g->spots[v_num[i]].name); //输出路径上的起点 - floyd_print(g, v_num[i], v_num[i + 1]); //利用Floyd算法得到这两点之间的最短路径 - dis += distances[v_num[i]][v_num[i + 1]]; //算出最短路长度 - } - printf("%s\n\n", g->spots[v_num[count - 1]].name); //输出路径上的终点 - printf(" 全程总长为:%dm\n\n", dis); -} -void put_map() -{ - printf("***************************************************************************************************************\n"); - printf("* 『故宫博物院景点地图一览』 *\n"); - printf("* *\n"); - printf("* ⑾◎御花园 ⑽◎乾隆花园 *\n"); - printf("* // \\\\ \\\\ *\n"); - printf("* ⑸◎乾清门<=====>⑻◎养心殿 \\\\ ⑼◎永和宫 *\n"); - printf("* \\\\ \\\\ // *\n"); - printf("* ⑺◎慈宁宫 ◎⑹皇极殿 *\n"); - printf("* // // *\n"); - printf("* ⑶◎中和殿 ⑷◎九龙壁 *\n"); - printf("* \\\\ // *\n"); - printf("* \\\\ // *\n"); - printf("* \\\\ // *\n"); - printf("* \\\\ // *\n"); - printf("* ⑵◎太和门 *\n"); - printf("* || *\n"); - printf("* || *\n"); - printf("* || *\n"); - printf("* || *\n"); - printf("* ⑴◎午门 *\n"); - printf("***************************************************************************************************************\n"); -} - -int put_menu() -{ - int op; - printf("\n"); - printf(" * * ******** * * ******** \n"); - printf(" * * * * * * * \n"); - printf(" ******* ******* * * * * \n"); - printf(" * * * * * * * \n"); - printf(" * * ******** ******* ******* ******** \n\n"); - printf(" \n"); - printf(" \n"); - printf(" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n"); - printf(" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n"); - printf(" = = = =\n"); - printf(" = = 欢迎使用故宫博物院导航咨询系统 = =\n"); - printf(" = = = =\n"); - printf(" = = 请选择功能: = =\n"); - printf(" = = = =\n"); - printf(" = = 1.查看故宫地图 5.游玩路径策划 = =\n"); - printf(" = = = =\n"); - printf(" = = 2.查看景点信息 6.我对故宫有话说 = =\n"); - printf(" = = = =\n"); - printf(" = = 3.寻找两景点之间的最短路径 7.查看评论 = =\n"); - printf(" = = = =\n"); - printf(" = = 4.寻找两景点之间所有路径 8.退出系统 = =\n"); - printf(" = = = =\n"); - printf(" = = = =\n"); - printf(" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n"); - printf(" = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n"); - printf("\n\n"); - printf(" 请根据你的需求选择操作:"); - scanf("%d", &op); - return op; -} - -void putEdge(Graph *g) -{ - for (int i = 1; i <= g->nodes_num; i++) - { - for (int j = 1; j <= g->nodes_num; j++) - { - if (g->edges[i][j] == INF) - printf("INF "); - else - printf("%d ", g->edges[i][j]); - } - printf("\n"); - } -} - -void exit_system() -{ - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" \n"); - printf(" 期待您的下一次使用!!!\n"); - exit(0); -} - -int main() -{ - //system("color f5"); //改变颜色 - //put_map(); - int quit = 0; - Graph g; - get_graph(&g); //从文件读取信息建立故宫地图 - short_path(&g); //通过Floyd求出distances表与path表 - while (!quit) - { - //系统退出条件满足判定 - switch (put_menu()) - { - //打印主菜单 - case 1: - system("cls"); - put_map(); - break; //故宫景点平面图查询 - case 2: - system("cls"); - search(&g); - break; //故宫景点信息查询 - case 3: - system("cls"); - put_map(); - print_short_path(&g); - break; //两景点间最短路径查询 - case 4: - system("cls"); - put_map(); - print_all_path(&g); - break; //两景点间所有路线查询 - case 5: - system("cls"); - put_map(); - best_path(&g); - break; //多景点间访问最优路线查询 - case 6: - system("cls"); - comment(); - break; //对故宫的评价 - case 7: - system("cls"); - view_comment(); - break; //查看评价 - case 8: - system("cls"); - exit_system(); - break; //退出故宫导游咨询系统 - default: - printf(" 对不起!没有该选项对应的操作。\n\n"); - } - system("pause"); - system("cls"); - /*清屏*/ - } - return 0; -} diff --git a/main.exe b/main.exe deleted file mode 100644 index af70b9b..0000000 Binary files a/main.exe and /dev/null differ diff --git a/main.o b/main.o deleted file mode 100644 index 67e54bf..0000000 Binary files a/main.o and /dev/null differ diff --git a/map.txt b/map.txt deleted file mode 100644 index be6491d..0000000 --- a/map.txt +++ /dev/null @@ -1,26 +0,0 @@ -11 11 -1 午门 -午门居中向阳,位当子午,故名午门。 -2 太和门 -太和门是紫禁城内最大的宫门,也是外朝宫殿的正门。 -3 中和殿 -中和殿,故宫外朝三大殿之一,位于紫禁城太和殿、保和殿之间。 -4 九龙壁 -九龙壁,是影壁的一种,是中国传统建筑中用于遮挡视线的墙壁。位于紫禁城宁寿宫区皇极门外南三宫后。 -5 乾清门 -乾清门为紫禁城内廷的正宫门,乾清门面阔5间,进深3间,高约16m,单檐歇山屋顶,座落在高1.5m的汉白玉石须弥座上。 -6 皇极殿 -皇极殿为宁寿宫区的主体建筑,始建于清康熙二十八年(1689年),初名宁寿宫。 -7 慈宁宫 -慈宁宫(已经对游人开放)位于北京故宫内廷外西路隆宗门西侧。始建于明嘉靖十五年(1536年),是在仁寿宫的故址上,并撤除大善殿而建成。 -8 养心殿 -养心殿是始建于明代嘉靖年间,位于内廷乾清宫西侧。清代有八位皇帝先后居住在养心殿。 -9 永和宫 -永和宫是始建于明代的中国宫殿建筑,属于内廷东六宫之一,位于承乾宫之东、景阳宫之南。明永乐十八年(1420年)建成,初名永安宫,嘉靖十四年(1535年)更今名。清沿明旧,于康熙二十五年(1686年)重修,乾隆三十年(1765年)亦有修缮,光绪十六年(1890年)重修。 -10 乾隆花园 -宁寿宫花园位于宁寿宫后区西路。乾隆三十七年(1772年)至四十一年(1776年)改建宁寿宫时,在后区西部南北长160m,东西宽约40m的窄长地段内建成一座花园,以备乾隆皇帝归政后游赏,故又称乾隆花园。 -11 御花园 -御花园位于北京紫禁城中轴线上大内最北部,坤宁宫后方,明代称为宫后苑,清代称御花园。始建于明永乐十八年 (1420年),以后曾有增修,现仍保留初建时的基本格局。 - - -