用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - c代码库

航空订票系统

2016-09-19 作者: 梅西小王子举报

[c]代码库

#include<stdio.h>   
#include<string.h>   
#include<stdlib.h>   
#define OK 1   
#define TRUE 1   
#define FALSE 0   
#define ERROR 0   
#define OVERFLOW -2   
#define PR printf   
typedef int status;
typedef struct airline{  
    char line_num[8];//航班号   
    char plane_num[8];//飞机号   
    char end_place[20];//目的的   
    int total;//座位总数   
    int left;//剩余座位   
    struct airline *next;//下一个结点   
}airline;  
    
typedef struct customer{  
    char name[9];//顾客名   
    char line_num[8];//航班号   
    int seat_num;//座位号   
    struct customer *next;//下一个结点   
}customer;  
    
airline *init_airline(){//初始化链表   
    airline *l;  
    l=(airline*)malloc(sizeof(airline));  
    if(l==NULL){  
        exit(0);  
        }  
    l->next=NULL;  
    return l;  
}  
    
customer * init_customer(){//初始化链表   
    customer *l;  
    l=(customer*)malloc(sizeof(customer));  
    if(l==NULL){  
        exit(0);  
        }  
    l->next=NULL;  
    return l;  
}  
    
status insert_airline(airline **p,char *line_num,char *plane_num,char *end_place,int total,int left){//airline链表插入操作   
    airline *q;  
    q=(airline*)malloc(sizeof(airline));  
    strcpy(q->line_num , line_num);  
    strcpy(q->plane_num , plane_num);  
    strcpy(q->end_place , end_place);  
    q->total  =total;  
    q->left =left;  
    q->next=NULL;  
    (*p)->next=q;  
    (*p)=(*p)->next;  
 //   PR("insert %d ,%dis succssed!\n",e,bl);   
    return OK;  
    }

[源代码打包下载]




网友评论    (发表评论)

共1 条评论 1/1页

发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...