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

正文內(nèi)容

基于隊列和棧的電梯模擬系統(tǒng)設(shè)計-計算機科學(xué)與技術(shù)課程設(shè)計報告-資料下載頁

2025-08-06 00:00本頁面
  

【正文】 OK。}Status EnQueue(WQueue amp。Q,QElemType e) { QueuePtr p。 p=new QNode。 if(!p) return OVERFLOW。 pdata=e。pnext=NULL。 next=p。 =p。 return OK。}Status DeQueue(WQueue amp。Q,QElemType amp。e) { QueuePtr p。 if(==) return ERROR。 p=next。 e=pdata。 next=pnext。 if(==p) =。 free(p)。 return OK。}Status QueueEmpty(WQueue Q) { if(==) return TRUE。 else return FALSE。}Status QDelNode(WQueue amp。Q,QueuePtr p) { QueuePtr q。 if(p==NULL||pnext==NULL) return ERROR。 q=pnext。 pnext=qnext。 if(pnext==NULL) =p。 DestoryClient(qdata)。 free(p)。 return OK。}Status CGiveUp(WQueue amp。Q,int floor) { QueuePtr p。 p=。 if(pnext!=NULL) if(pnextdataGivepuTime==0amp。amp。floor!=pnextdataInfloor) { PrintClientInfo(*(pnextdata),GiveUp)。 TotalTime+=TimeCInTime(*(pnextdata))。 QDelNode(Q,p)。 GiveUpNumber++。 } else pnextdataGivepuTime。 return OK。}void PrintQueue(WQueue Q) { QueuePtr q。 int count=0。 if(next==NULL) goto end。 q=next。 while(q!=NULL) { coutsetw(3)qdataClinetID39。 39。 q=qnext。 count++。 }end: while(count++=4) cout 。}void InOut(Elevator amp。E,WQueue w[Maxfloor+1][2]) { Client *p。 if([]) if(StackEmpty([])) []=0。 else { Pop([],p)。 InOutCount=InOutTime。 PrintClientInfo(*p,Out)。 TotalTime+=TimeCInTime(*p)。 DestoryClient(p)。 } if([]==0) if(!QueueEmpty(w[][])) { DeQueue(w[][],p)。 Push([COutfloor(*p)],p)。 if([COutfloor(*p)]!=1) { [COutfloor(*p)]=1。 } ++。 InOutCount=InOutTime。 PrintClientInfo(*p,In)。 } else { if(==Down) []=0。 else []=0。 }}void NewClient(Elevator amp。E,WQueue w[5][2]) { Client *p。 CreatClient(p)。 if(GoAbove(*p)) { EnQueue(w[CInfloor(*p)][Up],p)。[CInfloor(*p)]=1。 } else { EnQueue(w[CInfloor(*p)][Down],p)。[CInfloor(*p)]=1。 }}void Print(Elevator amp。E,Action a) { switch(a) { case DoorOpened:printf(%\t電梯門已打開.\n)。break。 case DoorClosed:printf(%\t電梯門已關(guān)閉.\n)。break。 case Achieved:printf(%\t電梯已到達(dá)第%d層。\n,)。break。 case GoingUp:printf(%\t電梯上升中...\n)。break。 case GoingDown:printf(%\t電梯下降中...\n)。break。 default:break。 }。}int main() { Elevator E。 cout\n**************************** 歡迎使用電梯模擬系統(tǒng) ****************************endl。 WQueue w[Maxfloor+1][2]。 InitEle(E)。 srand( (unsigned)time( NULL ))。 for(int i=0。i=Maxfloor。i++) { InitQueue(w[i][Up])。 InitQueue(w[i][Down])。 } MaxTime=1000000。 printf(請輸入電梯的運行時間:)。 scanf(%d,amp。MaxTime)。 printf(\n)。 while(Time++MaxTime) { if(InterTime==0) NewClient(E,w)。 else InterTime。 for(int i=0。i=Maxfloor。i++) for(int j=0。j2。j++) { CGiveUp(w[i][j],EleFloor(E))。 } if(InOutCount==0) { if(EleStatus(E)==Opened) InOut(E,w)。 } else InOutCount。 if(CountOver(E)||EleStatus(E)==Closed||EleStatus(E)==Waiting) { Action a。 a=ElevatorRun(E)。 Print(E,a)。 } Sleep(100)。 } printf(%共%d人進(jìn)入系統(tǒng),,ID)。 printf(%共%d人放棄。,GiveUpNumber)。 DestoryEle(E)。 for(i=0。i=Maxfloor。i++) { DestroyQueue(w[i][Up])。 DestroyQueue(w[i][Down])。 } return 0。}22
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1