91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.62MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-08-31
  • 語言: C/C++
  • 標簽: 親測可用??

資源簡介

這個是一個電梯的模擬運行程序可視化顯示電梯的運行狀態

資源截圖

代碼片段和文件信息


#include?“dian.h“
#include“time.h“
#include“cstring“
#include“ctime“
?Lift?dian::lift[16];
passenger?dian::person;
extern??int?time1;



dian::dian()
{

for(int?i=1;i<15;i++)
{
lift[i].addper=0;
lift[i].delper=0;

}
// cout<<“輸入你模擬的時間段,1?高峰期?2?低峰期“;
// cin>>time1;
Umaxfloor=14;//這棟樓的電梯最大為14層
dmaxfloor=1;//這棟樓的電梯是從1層開始的
Nowfloor=0;//出事化時電梯在一層
total=0;//電梯中的總人數初始0
zhuangtai=0;//記錄電梯的狀態
}



/////////////////////////////////////////////////////////////////////////////
//?dian?message?handlers

void?dian::add(QueuePtr?w)
{
//將乘客接入向上升電梯
???int?i=w->endfloor;//將乘客要上到的樓層賦值給i
???List?*q;
???q=(List*)malloc(sizeof(List));
???q->endfloor=w->endfloor;
???q->nowfloor=w->nowfloor;
???strcpy(q->namew->name);
???q->muptime=w->muptime;
???q->suptime=w->suptime;
???lift[i].list1.add(q);//將乘客加到他要下的那一層的上電梯的鏈表里
???total++;
???string?s1s;
???//CString?s1s;
??//?s=“?“;
???//m_puanduan.SetWindowText(s);
???lift[w->nowfloor].addper++;????
???//s1.Format(“%d“total);
???cout<<“電梯中的總的人數“<??//?m_total.SetWindowText(s1);
???person.del(w->nowfloor);//將上電梯的乘客刪除
???// UpdateData();
???Sleep(2000);
}

void?dian::del(int?floor)
{
ctime?time=CTime::GetCurrentTime();//
Sleep(100);
List1?q;
int?i=0;
int?mtimestimetotaltime;
????while(lift[floor].list1.length()!=0)
{??i++;
???lift[floor].delper++;
????total--;
????CString?s2s1;
s2.Format(“%d“total);
m_total.SetWindowText(s2);
q=lift[floor].list1.get();
stime=time.GetSecond();
????????mtime=time.GetMinute();
if(mtime>q->muptime)
{
???????????totaltime=60-q->suptime+stime;
}
else
totaltime=stime-q->suptime;
????????s1.Format(“在%d上電梯在%d下電梯用時%d秒“q->nowfloorq->endfloortotaltime);//電梯中的總人數
???????cout<<“所用的時間“< //?m_time.SetWindowText(s1);
lift[floor].list1.del();
???}
CString?s0s;
????????s0.Format(“%d層有“floor);
s.Format(“%d人下電梯“i);
????????s0=s0+s;
????????m_xia.SetWindowText(s0);
RedrawWindow();
Sleep(2000);

??
}

int?dian::downyi(int?floor)
{
??CTime?time=CTime::GetCurrentTime();//
??int?mtimestimetotaltime;
??int?Floor;
??CString?s;
??floor--;
??s.Format(“%d“floor);
??m_lou.SetWindowText(s);//顯示現在的樓層
??downmove(floor);//當電梯有人呼叫的時候讓電梯一層一層的運行到達呼叫的乘客的樓層
??if(lift[floor].list1.length()!=0)
{
??del(floor);
}
??if(lift[floor].downwaiter.length()==0&&lift[floor].upwaiter.length()==0)
{//沒有人上車
if(total==0)
{
//電梯中沒有人
??????????if((Floor=panduan())!=0)
??{
??CString?s3;
??s3.Format(“有%d“Floor);
??s3=s3+“層呼叫電梯“;
??m_puanduan.SetWindowText(s3);
??RedrawWindow();
??if(Floor ??downGetper(floorFloor);
??else
??upGetper(floorFloor);
????????????if(lift[Floor].upwaiter.length()!=0)
{ QueuePtr?q;
????int?i=0;
//呼叫的乘客是向上走的
while(lift[Floor].upwaiter.length()!=0)
{
i++;
//while()循環將乘客裝入電梯
if(total==12)
{//電梯裝滿了
return?upyi(Floor);
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-01-11?23:10??dian\
?????目錄???????????0??2015-01-11?22:40??dian\Debug\
?????文件?????5344272??2015-01-11?22:40??dian\Debug\dian.pch
?????文件????????4426??2015-01-11?22:19??dian\Debug\dui.obj
?????文件????????4286??2015-01-11?22:19??dian\Debug\lian.obj
?????文件???????13605??2015-01-11?22:23??dian\Debug\queue.obj
?????文件??????197632??2015-01-11?22:47??dian\Debug\vc60.idb
?????文件??????110592??2015-01-11?22:47??dian\Debug\vc60.pdb
?????文件???????26369??2015-01-11?22:47??dian\dian.cpp
?????文件????????4199??2015-01-11?22:12??dian\dian.dsp
?????文件?????????516??2015-01-11?22:12??dian\dian.dsw
?????文件????????1443??2015-01-11?22:40??dian\dian.h
?????文件???????50176??2015-01-11?23:12??dian\dian.ncb
?????文件???????50688??2015-01-11?23:10??dian\dian.opt
?????文件???????11486??2015-01-11?22:47??dian\dian.plg
?????文件???????????0??2015-01-11?22:17??dian\dui.asp
?????文件????????1260??2015-01-11?22:19??dian\dui.cpp
?????文件?????????551??2015-01-11?22:18??dian\dui.h
?????文件???????????0??2015-01-11?22:14??dian\lian.asp
?????文件?????????890??2015-01-11?22:19??dian\lian.cpp
?????文件?????????681??2015-01-11?22:18??dian\lian.h
?????文件?????????853??2015-01-11?22:23??dian\queue.cpp
?????文件?????????685??2015-01-11?22:23??dian\queue.h
?????文件?????????853??2015-01-11?22:19??dian\squeue.cpp
?????文件?????????685??2015-01-11?22:18??dian\squeue.h

評論

共有 條評論