大一的課程設計

2021-10-07 05:44:28 字數 2850 閱讀 7179

#include#include#include#include#define max 20

#define infinity 9999

typedef struct arcell bianchang[max][max];

typedef struct node point;

typedef struct graph;

int dist[max][max]; /*距離向量型別*/

int path[max][max]; /*路徑型別*/

int m[max]= ;

int p[20];

int count = 0;

int visited[max] = ;

int inf[max] = ;//盛春強

void view(graph *g)

}void rewrite(graph *p)

for(i=1; i<=p->vexnum; i++)

for(j=1; j<=i; j++)

fclose(fp);

}int shuru(graph *g)

return m;

}void shortestpath_fld(graph *g)

}void floyd_print(graph *g, int snum, int enum)

}void bestpath(graph *g) ,j=1;

int i; /*記錄使用者輸入的編號資訊*/

int d=0; /*統計全程總長*/

printf("請輸入你需要一起遊覽的個數:");

scanf("%d",&a);

printf("請輸入你要遊覽的第%d個景點的編號(數字間用回車分隔):",j);

vnum[j-1]=shuru(g);//scanf("%d",&vnum[j-1]);

while(vnum[j-1]&&j0&&vnum[i+1]>0

printf("%s->->",g->spot[vnum[i]].name); /*輸出路徑上的起點*/

floyd_print(g,vnum[i],vnum[i+1]); /*利用佛洛依德演算法*/

d+=dist[vnum[i]][vnum[i+1]];

} printf("%s\n",g->spot[vnum[j-1]].name); /*輸出路徑上的終點*/ // g->spot[vnum[i]]

printf("\n全程總長為:%dm\n",d);

printf("完畢,按任意鍵繼續!\n");

getch();

}void map()

void menu()

int panduan(int b,int s,int a)

} return 1;

}void dfs(graph *g, int i, int j, int s) else

for (k = 1; k <= g->vexnum; k++) }}}

void alldfs(graph *g, int i, int j)

void odfs(graph *g)

void initgraph(graph *p)

int x,y,m;

for(i=1; i<=p->arcnum; i++)

fclose(fp);

}void wellway(graph * g) else

} flag=1;

while(flag) else

} for(v=0; vvexnum; v++) }

d[v0]=0;

final[v0]=1;

for(i=1;i<=g->vexnum;i++) }

v=v1;

w1=v0;

printf("%s",g->spot[v0].name);

do else break;

} while(1);

printf("\n 總路線長%dm\n\n",d[v]);

printf("完畢,按任意鍵繼續!\n");

getch();

}int find(graph *g,int a) else

}void ofind(graph *g)

printf("是否繼續查詢?1.是2.否\n");

scanf("%d",&j);

switch(j)

}void increasepath(graph *g)

rewrite(g);

}void newpath(graph *g,int x)

rewrite(g);

}void increasesight(graph *g)

newpath(g,g->vexnum);

}void deletesight(graph *g) else

strcpy(g->spot [a].name,g->spot [g->vexnum].name );

strcpy(g->spot[a].introduce ,g->spot[g->vexnum].introduce );

printf("已找到該點,刪除成功!\n");

g->vexnum--;

} }rewrite(g);

}void deletepath(graph *g)

int main() else else

break;

case 0:

exit(0);}}

}} }

return 0;

}

課程設計表

create database drug 藥品表 create table drug did nvarchar 10 primary key,dname nvarchar 50 not null,dimage nvarchar 100 not null,dmodel nvarchar 10 chec...

課程設計總結

課程設計今天終於完了,答辯之後感悟挺多的,一方面,覺得自己的努力獲到了應有的成果,當然也有很多不足及未完成的地方 另一方面,看到很多其他同學好的設計及思想。覺得很多方面都值得自己學習,自己還有很多方面都很欠缺,本次課程設計我和兩個同學共三個人做了聊天程式,仿qq做的。聊天軟體,是我之前一直想完成的乙...

課程設計備份

include include include include define size 100 define increase 10 struct nodel 順序表 typedef struct tree btree,bnode 二叉樹struct stackt 棧int caidan int i...