没有合适的资源?快使用搜索试试~ 我知道了~
飞机场航班管理信息系统
4星 · 超过85%的资源 需积分: 31 6 下载量 69 浏览量
2014-05-21
15:12:16
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
6页
航班管理系统 typedef struct { slnode sl[maxspace]; int keynum; int length; }sllist; typedef int arrtype_n[radix_n]; typedef int arrtype_c[radix_c]; void distribute(slnode *sl,int i,arrtype_n f,arrtype_n e) { int j,p; for(j=0;j<radix_n;j++) { f[j]=e[j]=0; } for(p=sl[0].next;p;p=sl[p].next)
资源推荐
资源详情
资源评论
#include<stdio.h>
struct node{
int num;
int time;
struct node *next;
};
/*--------------------全局变量,方便调用函数----------------------------------------------------------------*/
struct node *takeoff,*landon,*p,*q,*r,*s,*runway[20];
int times=0,i,num_t=1,num_l=5001,m,n,way,take,land,whole=0;
int total_time1=0,total_time2=0;
/*--------------------计数1,记录降落的总时间--------------------------------------------------------------*/
count1(){
r=landon->next;
while(r!=NULL){
total_time1++;
r=r->next;
}
}
/*---------------------计数2,记录起飞的总时间-----------------------------------------------------------*/
count2(){
r=takeoff->next;
while(r!=NULL){
total_time2++;
r=r->next;
}
}
/*----------------------跑到占用时间--------------------------------------------------------------------*/
count3(){
for(i=1;i<=way;i++)
if(runway[i]->next!=NULL)
struct node{
int num;
int time;
struct node *next;
};
/*--------------------全局变量,方便调用函数----------------------------------------------------------------*/
struct node *takeoff,*landon,*p,*q,*r,*s,*runway[20];
int times=0,i,num_t=1,num_l=5001,m,n,way,take,land,whole=0;
int total_time1=0,total_time2=0;
/*--------------------计数1,记录降落的总时间--------------------------------------------------------------*/
count1(){
r=landon->next;
while(r!=NULL){
total_time1++;
r=r->next;
}
}
/*---------------------计数2,记录起飞的总时间-----------------------------------------------------------*/
count2(){
r=takeoff->next;
while(r!=NULL){
total_time2++;
r=r->next;
}
}
/*----------------------跑到占用时间--------------------------------------------------------------------*/
count3(){
for(i=1;i<=way;i++)
if(runway[i]->next!=NULL)
runway[i]->time++;
}
/*---------------------飞机倒计时-----------------------------------------------------------------------*/
count4(){
for(i=1;i<=way;i++)
if(runway[i]->next!=NULL)
runway[i]->next->time--;
}
/*---------------------查询队列中的飞机状态,在跑道为空的时候放入飞机----------------------------------*/
find(){
for(i=1;i<=way;i++){
if(runway[i]->next==NULL){//i跑道是空的
if(landon->next!=NULL){//降落队列中有飞机剩余
r=landon->next;
landon->next=r->next;//从降落队列中删除r指向的飞机
if(landon->next==NULL)//降落队列中没有飞机
q=landon;
r->next=NULL;
runway[i]->next=r;//将飞机放到跑道上,或者r指向NULL就赋值为NULL;
printf("airplane %04d is ready to land on runway %02d\n",r->num,i);
}
else if(takeoff->next!=NULL){//起飞队列中有飞机
r=takeoff->next;
takeoff->next=r->next;
}
/*---------------------飞机倒计时-----------------------------------------------------------------------*/
count4(){
for(i=1;i<=way;i++)
if(runway[i]->next!=NULL)
runway[i]->next->time--;
}
/*---------------------查询队列中的飞机状态,在跑道为空的时候放入飞机----------------------------------*/
find(){
for(i=1;i<=way;i++){
if(runway[i]->next==NULL){//i跑道是空的
if(landon->next!=NULL){//降落队列中有飞机剩余
r=landon->next;
landon->next=r->next;//从降落队列中删除r指向的飞机
if(landon->next==NULL)//降落队列中没有飞机
q=landon;
r->next=NULL;
runway[i]->next=r;//将飞机放到跑道上,或者r指向NULL就赋值为NULL;
printf("airplane %04d is ready to land on runway %02d\n",r->num,i);
}
else if(takeoff->next!=NULL){//起飞队列中有飞机
r=takeoff->next;
takeoff->next=r->next;
剩余5页未读,继续阅读
资源评论
- aaaaa工2014-07-08值得, 有参考价值
hgj3804278
- 粉丝: 7
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功