[课设]校园导游咨询系统 课程设计 改良版

作者在 2007-07-07 11:15:00 发布以下内容

这好像是网上一个比较热门的课程设计,而且看见某位同学的杰作在网上传播已久了,自己阅读代码发现其中稍有不足,所以拿来练练手,做个改良。

不过,希望直接拷贝后上交的同学,那有点儿不太可能,一方面是initgraph函数的参数需要自行调整,另一方面,平面图我是随便画的,还需要重新美化一下(请别怪我懒,我是练手的,不是交作业的 哈哈)。

问题是这个样子的:

【问题描述】
设计一个校园导游程序,为来访的客人提供信息查询服务。
【基本要求】
(1) 设计学校的校园平面图,所含景点不少于10个,以图中顶点表示校内各景点,存放景点名称、代号、简介等信息,以边表示路径,存放路径长度等相关信息。
(2) 为来访客人提供图中任意景点相关信息的查询;
(3) 为来访客人提供从校门口到图中任意景点的问路查询;

代码:

#include<stdio.h>
#include<process.h>
#include <graphics.h>
#define INT_MAX 10000
#define n 10
int cost[n][n];
int shortest[n][n];
int path[n][n];
void introduce();
int shortestdistance();
void floyed();
void display(int i,int j);
void view();
void main()
{
    int i,j;
    int x;
        int gdriver,gmode;
    int arw[10]={20,102,300,38,232,86,125,98,280,147};
    char k;
    gdriver=VGA;gmode=VGAHI;
    for(i=0;i<=n;i++)
        for(j=0;j<=n;j++)
            cost[j]=INT_MAX;
    cost[1][2]=cost[2][1]=2;
    cost[2][3]=cost[3][2]=1;
    cost[2][4]=cost[4][2]=2;
    cost[3][4]=cost[4][3]=4;
    cost[1][4]=cost[4][1]=5;
    cost[2][5]=cost[5][2]=3;
    cost[5][10]=cost[10][5]=8;
    cost[5][6]=cost[6][5]=2;
    cost[6][7]=cost[7][6]=1;
    cost[7][8]=cost[8][7]=3;
    cost[7][9]=cost[9][7]=3;
    cost[8][9]=cost[9][8]=4;
    cost[1][1]=cost[2][2]=cost[3][3]=cost[4][4]=cost[5][5]=0;
    cost[6][6]=cost[7][7]=cost[8][8]=cost[9][9]=cost[10][10]=0;
    while(1)
    {
        printf("----------------welcome!!!----------------\n");
        printf("1.View Searching???Please press i (introduc)\n");
        printf("2.the shortest way searching?please press s (shortestdistance)\n");
        printf("3.exit ……………please press e (exit)\n");
        printf("4.show view…………please press v (view)\n");
        printf("the list of the university:\n");
        printf("1:north gate  ");
        printf("2:theatre    ");
        printf("3:Arena   ");
        printf("4:Art Area    ");
        printf("5:Bridge\n");
        printf("6:restrant    ");
        printf("7:bank    ");
        printf("8:office    ");
        printf("9:library  ");
        printf("10:south restuarant\n");
        printf("Please select:");
        scanf("\n%c",&k);
        switch(k)
        {
 

C语言开拓 | 阅读 1770 次
文章评论,共2条
海啸南风(作者)
2007-07-08 03:56
1
现在大学流行课程设计上网找,希望来访的朋友不要那样做,至少分析一下代码再上交。千万不要让那些收费代做课程设计毕业论文的垃圾网站继续猖獗!!!!!大家加油!
海啸南风(作者)
2008-01-23 01:52
2
完整代码呢?我也不知道整哪儿去了啊:(

等我到硬盘里找找看.
游客请输入验证码