📄 【学习】关于电梯算法的c++实现.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0043)http://www.softat.org/thread-52395-1-1.html -->
<HTML><HEAD><TITLE>【学习】关于电梯算法的C++实现 - c/c++/VC/BC - 软件架构-信息技术论坛 软件架构-信息技术</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<META
content=",软件架构 设计模式 编程语言 C++ VB VC Delphi php asp .net java,信息技术,通信,GSM,CDMA"
name=keywords>
<META
content="软件架构-信息技术论坛 软件架构 设计模式 编程语言 C++ VB VC Delphi php asp .net java,信息技术,通信,GSM,CDMA"
name=description>
<META content=TRUE name=MSSmartTagsPreventParsing>
<META http-equiv=MSThemeCompatible content=Yes><LINK title=软件架构-信息技术论坛
href="http://www.softat.org/archiver/" rel=archives><LINK id=css
href="【学习】关于电梯算法的C++实现.files/style_2.css" type=text/css rel=stylesheet>
<SCRIPT src="【学习】关于电梯算法的C++实现.files/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="【学习】关于电梯算法的C++实现.files/menu.js" type=text/javascript></SCRIPT>
<SCRIPT src="【学习】关于电梯算法的C++实现.files/ajax.js" type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>var IMGDIR = 'images/default';var SMDIR = 'images/smilies';</SCRIPT>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY onkeydown="if(event.keyCode==27) return false;">
<CENTER>
<DIV class=mainborder id=jsmenu_parent></DIV><!--<div class="mainheader"><div class="logo"><div class="maintable"><script type="text/javascript"><!--
google_ad_client = "pub-1342436837907284";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-06-10: softat
google_ad_channel = "2319024336";
google_color_border = "FFFFFF";
google_color_bg = "E9EDF7";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
//--></SCRIPT>
<SCRIPT src="【学习】关于电梯算法的C++实现.files/show_ads.js" type=text/javascript>
</SCRIPT>
<DIV></DIV>
<DIV></DIV>
<DIV class=menu>
<DIV class=maintable><SPAN class=bold>游客: </SPAN><A
href="http://www.softat.org/register.php">注册</A> | <A
href="http://www.softat.org/logging.php?action=login">登录</A> | <A
href="http://www.softat.org/member.php?action=list">会员</A> | <A
href="http://www.softat.org/search.php">搜索</A> | <A
href="http://www.softat.org/faq.php">帮助</A> </DIV></DIV>
<DIV></DIV>
<DIV class=maintable><BR>
<DIV class="subtable nav" style="WIDTH: 98%"><A
href="http://www.softat.org/index.php">软件架构-信息技术论坛</A> » <A
href="http://www.softat.org/forum-21-1.html">c/c++/VC/BC</A> »
【学习】关于电梯算法的C++实现</DIV><BR></DIV>
<DIV class=maintable>
<TABLE style="CLEAR: both" cellSpacing=0 cellPadding=0 width="98%"
align=center><TBODY>
<TR>
<TD vAlign=bottom>
<DIV style="MARGIN-BOTTOM: 4px"><A style="FONT-WEIGHT: normal"
href="http://www.softat.org/redirect.php?fid=21&tid=52395&goto=nextoldset">‹‹
上一主题</A> | <A style="FONT-WEIGHT: normal"
href="http://www.softat.org/redirect.php?fid=21&tid=52395&goto=nextnewset">下一主题
››</A><BR></DIV></TD>
<TD vAlign=bottom align=right width="40%">
<DIV class=right> <A
href="http://www.softat.org/post.php?action=reply&fid=21&tid=52395&extra=page%3D1"><IMG
alt="" src="【学习】关于电梯算法的C++实现.files/reply.gif" border=0></A></DIV>
<DIV class=right id=newspecialheader onmouseover=showMenu(this.id)><A
href="http://www.softat.org/post.php?action=newthread&fid=21&extra=page%3D1"><IMG
alt="" src="【学习】关于电梯算法的C++实现.files/newtopic.gif" border=0></A><A
href="http://www.softat.org/thread-52395-1-1.html###"><IMG alt=""
src="【学习】关于电梯算法的C++实现.files/newspecial.gif" border=0></A></DIV>
<DIV class="popupmenu_popup newspecialmenu" id=newspecialheader_menu
style="DISPLAY: none">
<TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
<TBODY>
<TR>
<TD class=popupmenu_option>
<DIV class=newspecial><A
href="http://www.softat.org/post.php?action=newthread&fid=21&extra=page%3D1&poll=yes">投票</A></DIV></TD></TR>
<TR>
<TD class=popupmenu_option>
<DIV class=newspecial><A
href="http://www.softat.org/post.php?action=newthread&fid=21&extra=page%3D1&trade=yes">交易</A></DIV></TD></TR>
<TR>
<TD class=popupmenu_option>
<DIV class=newspecial><A
href="http://www.softat.org/post.php?action=newthread&fid=21&extra=page%3D1&reward=yes">悬赏</A></DIV></TD></TR>
<TR>
<TD class=popupmenu_option>
<DIV class=newspecial><A
href="http://www.softat.org/post.php?action=newthread&fid=21&extra=page%3D1&activity=yes">活动</A></DIV></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>function fastreply(subject) {if($('postform')) {$('postform').subject.value = subject;$('postform').message.focus();}}</SCRIPT>
<DIV class=maintable>
<DIV class=spaceborder style="WIDTH: 98%; BORDER-BOTTOM: medium none">
<TABLE cellSpacing=0 cellPadding=4 width="100%" align=center>
<TBODY>
<TR class=header>
<TD style="COLOR: #154ba0" colSpan=2>
<DIV class=right style="FONT-WEIGHT: normal"><A
href="http://www.softat.org/viewthread.php?action=printable&tid=52395"
target=_blank>打印</A> | <A
href="http://www.softat.org/misc.php?action=emailfriend&tid=52395">推荐</A>
| <A id=ajax_subscription onclick="ajaxmenu(event, this.id)"
href="http://www.softat.org/my.php?item=subscriptions&subadd=52395">订阅</A>
| <A id=ajax_favorite onclick="ajaxmenu(event, this.id)"
href="http://www.softat.org/my.php?item=favorites&tid=52395">收藏</A>
</DIV>标题: 【学习】关于电梯算法的C++实现</TD></TR></TBODY></TABLE></DIV>
<FORM name=delpost
action=topicadmin.php?action=delpost&fid=21&tid=52395&page=1
method=post><INPUT type=hidden value=e759cc30 name=formhash>
<DIV class=spaceborder
style="BORDER-TOP: medium none; MARGIN-BOTTOM: 4px; WIDTH: 98%">
<TABLE class=t_row cellSpacing=0 cellPadding=4 width="100%" align=center>
<TBODY>
<TR style="HEIGHT: 100%">
<TD class=t_user vAlign=top width="18%"><A name=pid52596></A><A
name=lastpost></A><A class=bold
href="http://www.softat.org/space-uid-1.html" target=_blank>Visual_Li</A>
<BR>
<DIV class=smalltxt>管理员<BR><IMG alt="Rank: 9"
src="【学习】关于电梯算法的C++实现.files/star_level3.gif"><IMG alt="Rank: 9"
src="【学习】关于电梯算法的C++实现.files/star_level3.gif"><IMG alt="Rank: 9"
src="【学习】关于电梯算法的C++实现.files/star_level1.gif"><BR>微蓝的海水<BR><BR>
<TABLE style="TABLE-LAYOUT: fixed; OVERFLOW: hidden" cellSpacing=0
cellPadding=0 width="95%" border=0>
<TBODY>
<TR>
<TD align=middle>
<DIV class=avatar style="WIDTH: 90px"><IMG height=90 alt=""
src="【学习】关于电梯算法的C++实现.files/05.gif" width=90
border=0></DIV></TD></TR></TBODY></TABLE><BR>UID 1<BR>精华 0<BR>积分
16832<BR>帖子 53150<BR>威望 16832 <BR>阅读权限 102<BR>注册 2005-3-15<BR>状态 离线
</DIV></TD>
<TD
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"
vAlign=top width="82%">
<TABLE class=t_msg cellSpacing=0 cellPadding=4 border=0>
<TBODY>
<TR>
<TD>
<DIV>
<DIV class="right t_number"><A class=bold title=复制帖子链接到剪贴板
onclick="setcopy('http://www.softat.org/viewthread.php?tid=52395&page=1#pid52596', '已经复制到剪贴板')"
href="http://www.softat.org/thread-52395-1-1.html###">#1</A></DIV>
<DIV class=right style="PADDING-TOP: 4px"><A
href="http://www.softat.org/magic.php?action=user&pid=52596"
target=_blank>使用道具</A> </DIV>
<DIV style="PADDING-TOP: 4px">发表于 2005-4-5 14:39 <A
href="http://www.softat.org/profile-uid-1.html"
target=_blank>资料</A> <A title=microblue的个人空间
href="http://www.softat.org/space-uid-1.html"
target=_blank>个人空间</A> <A href="http://www.softat.org/"
target=_blank>主页</A> <A
href="http://www.softat.org/pm.php?action=send&uid=1"
target=_blank>短消息</A> <A id=ajax_buddy_0
onclick="ajaxmenu(event, this.id)"
href="http://www.softat.org/memcp.php?action=buddylist&newbuddyid=1&buddysubmit=yes"
target=_blank>加为好友</A> <A
href="http://wpa.qq.com/msgrd?V=1&Uin=28033450&Site=软件架构-信息技术论坛&Menu=yes"
target=_blank><IMG alt=QQ
src="【学习】关于电梯算法的C++实现.files/qq1_offline.gif" border=0></A>
</DIV></DIV></TD></TR>
<TR>
<TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%">
<DIV style="FLOAT: right" align=right><A title="评分 0"
href="http://www.softat.org/misc.php?action=viewratings&tid=52395&pid=52596"></A></DIV><SPAN
class=bold>【学习】关于电梯算法的C++实现</SPAN><BR><BR>
<DIV class=t_msgfont id=message52596><SPAN><BR>
<P>众所周知,面向对象的程序设计更适合对现实生活中的描述,更加体现了软件的工业化的精神,所以现在大部分的软件开发工作都围绕OOP的思想来进行的。但是在对现实生活中的实际问题,如何对所研究的系统进行面向对象的分析与设计呢?本篇文章以一个实际的例子,向大家介绍一下如何对实际问题进行分析和设计。</P><BR>
<P> 一.问题描述:</P><BR>
<P> 该实例是一个电梯载客问题,问题的描述如下:</P><BR>
<P> 某贸易中心共10层,设有载客电梯1部。为了处理问题的方便,有以下的限定条件:</P><BR>
<P> (1) 电梯的运行规则是:可到达每层。</P><BR>
<P> (2) 每部电梯的最大乘员量均为K人(K值可以根据仿真情况在10~20人之间确定)。</P><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -