freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

基于隊列和棧的電梯模擬系統(tǒng)設計-計算機科學與技術課程設計報告(編輯修改稿)

2024-09-02 00:00 本頁面
 

【文章內容簡介】 強 C語言程序設計 清華大學出版社 [4] 與所用編程環(huán)境相配套的C語言或C++相關的資料 [5] 徐孝凱 數(shù)據(jù)結構課程實驗. 北京:清華大學出版社,2002. [6] 郭翠英 C語言課程設計案例精編. 北京:中國水利水電出版社,.源程序include include include include include include include //所有常量,全局變量和類型定義define NULL 0 define TRUE 1define FALSE 0define OK 1define ERROR 0define INFEASIBLE 1define OVERFLOW 2define INT_MAX 32767typedef int Status。 //Status是函數(shù)類型,其值是函數(shù)結果狀態(tài)代碼define Empty 0//電梯狀態(tài)enum EleStatus{Opening,Opened,Closing,Closed,Moving,Decelerate,Waiting}。enum Action{DoorOpened,DoorClosed,GoingUp,GoingDown,Achieved,None}。enum EleStage{Up,Down,OpenDoor,Stop}。enum ClientStatus{New,GiveUp,In,Out,Finish}。define CloseTest 40 //電梯關門測試時間define OverTime 300 //電梯停候超時時間define DoorTime 20 //開門關門時間define InOutTime 25 //進出電梯時間define Maxfloor 4 //最高層define Minfloor 0 //最低層long Time=0。 //時鐘long MaxTime。 //系統(tǒng)運行最長時間int InOutCount=0。 //用于進出計時int InterTime=0。 //下一乘客進入系統(tǒng)的時間int ID=0。 //乘客編號int GiveUpNumber=0。 //乘客放棄的數(shù)目int TotalTime=0。 //總共等待時間//乘客類型typedef struct { int ClinetID。 //乘客編號 int Outfloor。 //去哪層 int InTime。 //該乘客進入時間 int GivepuTime。 //所能容忍的等待時間 int Infloor。//乘客進入的樓層}Client。//乘客類型基本操作void PrintClientInfo(Client const amp。e,ClientStatus s) { switch(s) { case New: printf(\t%d號乘客進入第%d層.\n,)。break。 case GiveUp: printf(\t%d號乘客放棄等待.\n,)。break。 case Out: printf(\t%d號乘客走出電梯.\n,)。break。 case In:printf(\t%d號乘客走進電梯,要去第%d層.\n,)。break。default:break。 }。}Status CreatClient(Client *amp。p) { int d。 p=new Client。 if(!p) return OVERFLOW。 pClinetID=++ID。 printf(%d所能容忍的等待時間:,ID)。 scanf(%d,amp。d)。 pGivepuTime=d。 pInTime=Time。 printf(下一乘客要到達的時間:)。 scanf(%d,amp。d)。 InterTime=d。 printf(所要到達的樓層:)。 scanf(%d,amp。d)。 pOutfloor=d。 while((pInfloor=rand()%(Maxfloor+1))==pOutfloor)。 PrintClientInfo(*p,New)。 return OK。}Status DestoryClient(Client *amp。p) { delete p。 p=NULL。 return OK。}Status GoAbove(Client const amp。e) { if() return TRUE。 else return FALSE。}Status CInfloor(Client const amp。e) { return 。}Status CInTime(Client const amp。e) { return 。}Status COutfloor(Client const amp。e) { return 。}define STACK_INIT_SIZE 100 //存儲空間初始分配量define STACKINCREMENT 50 //存儲空間分配增量//乘客棧typedef Client *SElemType。 typedef struct { SElemType *base。 SElemType *top。 int stacksize。 }ClientStack。Status InitStack(ClientStack amp。S) { =(SElemType *)malloc(STACK_INIT_SIZE*sizeof(SElemType))。 if(!) return OVERFLOW。 =。 =STACK_INIT_SIZE。 return OK。}Status DestroyStack(ClientStack amp。S) { SElemType *p。 if() { for(p=。p。p++) DestoryClient(*p)。 free()。 } return OK。}Status ClearStack(ClientStack amp。S) { if(!) return ERROR。 =。 return OK。}Status StackEmpty(ClientStack S) { if(==) return TRUE。else return FALSE。}Status StackLength(ClientStack S) { return 。}Status GetTop(ClientStack S,SElemType amp。e) { if(!) return ERROR。 e=*()。 return OK。}Status Push(ClientStack amp。S,SElemType e) { if(!) return ERROR。 if(=) { =(SElemType *)realloc(,(+STACKINCREMENT)*sizeof(SEl
點擊復制文檔內容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1