花了一周的时间搞数据结构课程设计,现在想起来也不咋样。
航班信息检索与查询系统源代码
在”StdAfx.h”文件中:
#if !defined(AFX_STDAFX_H__5D4863DA_370E_4BF2_ACA1_DEF9B55C465C__INCLUDED_)
#define AFX_STDAFX_H__5D4863DA_370E_4BF2_ACA1_DEF9B55C465C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif
#define WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include <string.h>
#include"stdlib.h"
#include"cctype"
#endif
在”StdAfx.cpp”文件中:
#include "stdafx.h"
在” 航班信息检索与查询.h”文件中:
void Menu();
void Menu2();
void Save();
int Bsearch(int l,int r);
void Read_Inf();
void Search_Inf(int f);
void Add_Inf();
void Del_Inf();
void Dis_Inf(int k,int f);
bool Choice(char *s);
void Get_Tiket();
void Exit();
#define Max 100005
#define Maxn 36
#define N 20
typedef struct Plan{
char ID[10];
char start[N];
char end[N];
int money;
int space;
char Tdate[N];
char Tstart[N];
char Tend[N];
char name[N];
}PlanNode;
typedef struct Node{
char key[10];
PlanNode inf;
int next;
}SLNode;
typedef struct{
SLNode s[Max];
int keyCnt;
int PCnt;
}SList;
void Radix_Sort(SList &L);
在” 航班信息检索与查询.cpp”文件中:
#include "stdafx.h"
#include"航班信息检索与查询.h"
int x[Maxn],y[Maxn];
const int form[]={8,8,7,8,9,9,7,5,4};
SList L;
int main(int argc, char* argv[])
{
system("color 6");
L.PCnt=0;
L.keyCnt=6;
Read_Inf();
Menu();
return 0;
}
void Menu()
{
char ch[]=" ";
printf("%s┍┅┅┅┅┅┅┅┅┅┅┅┅┒\n",ch);
printf("%s│ 航班信息检索与查询 │\n",ch);
printf("%s┕┅┅┅┅┅┅┅┅┅┅┅┅┘\n",ch);
printf("%s┍┅┅┅┅┅┅┅┅┅┅┅┅┒\n",ch);
printf("%s│ 1.查询航班信息 │\n",ch);
printf("%s│ 2.显示全部航班信息 │\n",ch);
printf("%s│ 3.添加航班信息 │\n",ch);
printf("%s│ 4.