资源简介
通过双向循环链表进行数据存储,可以实现订票,买票,充值,选座位等功能,在管理员用户中,可以修改用户信息,航班信息等

代码片段和文件信息
/*********************************************
*文件名:func.c
*
*文件描述:航班信息处理函数集
*
*创建人: Maxwell
*
*创建时间:2018.10.25
*
*修改记录:无
*
**********************************************/
#include“func.h“
void init(node **head)
{
*head = (node *)malloc(sizeof(node));
if(*head == NULL)
{
printf(“[%s]malloc failed\n“__FUNCTION__);
exit(EXIT_FAILURE);
}
bzero(*headsizeof(node));
(*head)->next = *head;
(*head)->prev = *head;
}
void create(node *head)
{
while(1)
{ node *pnew = (node *)malloc(sizeof(node));
if(pnew == NULL)
{
printf(“[%s]malloc failed\n“__FUNCTION__);
exit(EXIT_FAILURE);
}
pnew->next = NULL;
pnew->prev = NULL;
// printf(“航班号 航空公司 起点站 终点站 班期 类型 起飞时间 到达时间 商务舱票价 经济舱票价 商务舱余票 经济舱余票\n“);
// printf(“input the info\n“);
// scanf(“%d%s%s%s%d%s%d%d%d%d%d%d“&(pnew->info.number)pnew->info.airlinepnew->info.stand_adresspnew->info.arrive_address&(pnew->info.data)pnew->info.type&(pnew->info.stime)&(pnew->info.atime)&(pnew->info.high_value)&(pnew->info.low_value)&(pnew->info.high_ticket)&(pnew->info.low_ticket));
// scanf(“%d“&(pnew->info.number));
bzero(pnewsizeof(node));
while(1)
{
printf(“input the number of airline\n“);
scanf(“%d“&(pnew->info.number));
if((pnew->info.number)>9999 || (pnew->info.number)<999)
{
printf(“input error\n“);
printf(“input again\n“);
}
else
break;
}
while(1)
{
printf(“input the name of airline\n“);
if(scanf(“%10s“pnew->info.airline) <= 10)
break;
fflush(stdin);
}
while(1)
{
fflush(stdin);
printf(“input the stand address\n“);
if(scanf(“%18s“pnew->info.stand_adress) == 1)
break;
}
while(1)
{
fflush(stdin);
printf(“input the arrive address\n“);
if(scanf(“%18s“pnew->info.arrive_address) ==1)
break;
}
while(1)
{
printf(“input the data of airline\n“);
scanf(“%d“&(pnew->info.data));
if(pnew->info.data>7 || pnew->info.data<0)
{
printf(“input error\n“);
printf(“input again\n“);
}
else
break;
}
printf(“input the type of ailine\n“);
scanf(“%8s“pnew->info.type);
while(1)
{
printf(“input the start time liru 10:20\n“);
scanf(“%d:%d“&(pnew->info.stime_hour)&(pnew->info.stime_min));
if((pnew->info.stime_hour>23 || pnew->info.stime_hour<0) || (pnew->info.stime_min>59 || pnew->info.stime_min<0))
{
printf(“input error\n“);
printf(“input again\n“);
}
else
break;
}
while(1)
{
printf(“input the arrive of airline liru 22:30\n“);
scanf(“%d:%d“&(pnew->info.atime_hour)&(pnew->info.atime_min));
if((pnew->info.atime_hour>23 || pnew->info.atime_hour<0) || (pnew->info.atime_min>59 ||pnew->info.atime_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 32768 2018-10-31 20:03 airline\.func.c.swp
..A..H. 12288 2018-11-02 12:24 airline\.func.h.swo
..A..H. 12288 2018-10-31 22:06 airline\.func.h.swp
..A..H. 20480 2018-11-06 22:31 airline\.main.c.swn
..A..H. 12288 2018-10-31 20:37 airline\.main.c.swp
..A..H. 12288 2018-10-31 12:46 airline\.test.c.swo
..A..H. 40960 2018-11-06 22:36 airline\.user.c.swn
..A..H. 24576 2018-10-31 22:12 airline\.user.c.swo
..A..H. 24576 2018-10-31 20:31 airline\.user.c.swp
文件 29814 2018-11-06 22:36 airline\a.out
文件 217 2018-11-06 22:37 airline\data.txt
文件 11723 2018-11-04 17:53 airline\func.c
文件 3165 2018-11-01 22:18 airline\func.h
文件 3765 2018-11-06 22:31 airline\main.c
文件 2875 2018-11-05 22:08 airline\show.c
文件 16438 2018-11-06 22:36 airline\user.c
文件 200 2018-11-06 22:37 airline\user_data.txt
目录 0 2018-11-11 12:54 airline
----------- --------- ---------- ----- ----
260709 18
相关资源
- Hi3536 Linux开发环境用户指南
- makefiletest.tar.gz
- 制作mipsel-linux交叉编译工具
- linux系统下的内存测试工具
- GNU/Linux系统开发者需要从桌面突破
- the_definitive_guide_to_linux_network_programm
- linux-shell脚本命令:grep命令简介
- Learning Linux Binary Analysis
- 蓝牙源代码应用于LINUX
- uboot到linux logo显示不间断 补丁
- UNIX/LINUX编程实践教程的源码
- Linux任务管理器
- linux应用层的华容道游戏源代码
- ubuntu9.10 可加载内核模块和字符设备驱
- MP3文件ID3v2ID3v2APEv2标签读取
- 课程作业:模拟仓库管理系统
- 操作系统实验——虚存管理实验
- linux下的发包工具sendip
- 尚观培训linux许巍关于c 的笔记和讲义
- 尚观培训linux董亮老师关于数据结构的
- linux 线程池源码 c 版
- linux C 电梯程序练习
- linux下用多进程同步方法解决生产者
- 一个简单实用个人日记管理系统
- 带时间温度显示的室内灯光控制系统
- 成绩管理系统(数据结构)
- Linux 操作系统实验(全)
- Linux From Scratch 中文手册
- FIR低通滤波器 ccs运行环境
- linux 网络实验 ftp程序
评论
共有 条评论