当前位置: 首页 > news >正文

动易学校网站管理系统 漏洞新氧网站头图怎么做的

动易学校网站管理系统 漏洞,新氧网站头图怎么做的,百度搜索推广开户,网站搜索 代码意图#xff1a;将对象组成树状结构以表示“部分#xff0d;整体”的层次结构#xff0c;使得Client对单个对象和组合对象的使用具有一致性。 上下文#xff1a;在树型结构的问题中#xff0c;Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装#xff0c… 意图将对象组成树状结构以表示“部分整体”的层次结构使得Client对单个对象和组合对象的使用具有一致性。 上下文在树型结构的问题中Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装统一简单元素和复杂元素的概念让对象容器自己来实现自身的复杂结构让Client可以像处理简单元素一样来处理复杂元素从而使Client与复杂元素的内部结构解耦 UML Component为Composite中的对象声明接口在适当情况下实现所有类公共接口的默认行为声明一个接口用于访问和管理Component的子部件在递归结构中定义一个接口用于访问一个父部件并在适当的情况下实现它。 Leaf在Composite中表示叶子对象。 Composite存储子部件并定义有子部件的那些部件的行为。 Client通过Component接口操作Composite的对象。 代码 #include iostream #include list using namespace std;class Component { public:string name;Component(string name):name(name){}virtual void add(Component *c) 0;virtual void remove(Component *c) 0;virtual void display(int depth) 0; };class Leaf:public Component { public:// Component interfaceLeaf(string name):Component(name){} public:void add(Component *c);void remove(Component *c);void display(int depth); };void Leaf::add(Component *c ) {(void)(c);//消除警告cout 不能向叶子中添加Component endl; }void Leaf::remove(Component *c) {(void)(c);//Warningcout 不能从叶子中删除Component endl; }void Leaf::display(int depth) {cout string(depth,-) this-name endl; }class Composite:public Component { public:listComponent* children;// Component interfaceComposite(string name):Component(name){} public:void add(Component *c);void remove(Component *c);void display(int depth); }; void Composite::add(Component *c) {children.push_back(c); }void Composite::remove(Component *c) {children.remove(c); }void Composite::display(int depth) {cout string(depth,-) this-name endl;listComponent*::iterator it;for(it children.begin();it ! children.end();it){Component *c *it;c-display(depth 2);} } int main() {Composite *root new Composite(树干);root-add(new Leaf(树叶1));root-add(new Leaf(树叶2));Composite *c1 new Composite(树枝1);c1-add(new Leaf(树叶1-1));c1-add(new Leaf(树叶1-2));root-add(c1);Composite *c1_1 new Composite(树枝1-1);c1_1-add(new Leaf(树叶1-1-1));c1_1-add(new Leaf(树叶1-1-2));c1-add(c1_1);root-add(new Leaf(树叶3));root-display(1);return 0; }结果 -树干 ---树叶1 ---树叶2 ---树枝1 -----树叶1-1 -----树叶1-2 -----树枝1-1 -------树叶1-1-1 -------树叶1-1-2 ---树叶3
http://www.huolong8.cn/news/214596/

相关文章:

  • 上海seo网站设计wordpress theme for free green
  • 网站留言发送到邮箱做行业网站赚钱吗
  • 青海高等级公路建设管理局网站app推广联盟平台
  • 东莞网站建设管理东莞专业网站制作设计
  • 山西网站建设开发惠州关键词排名提升
  • 沈阳网站建设小工作室网站只显示一个网址
  • 海南网站建设监理网络推广关键词优化公司
  • 济南做网站推广有哪些公司装饰设计公司排行榜
  • 网站开发流程管理怎么自创公众号
  • 网站怎么接广告赚钱vi设计欣赏网站
  • 旅游网站建设的概念wordpress 写模版
  • 360建设网站免费下载什么是高端网站建设
  • 辽宁建设工程招标网站怎么用网站建设
  • 杭州装饰网站建设方案中信建设有限责任公司招聘2021
  • 网站域名授权十大免费ppt网站软件
  • 梁平区高点击量网站建设哪家好怀化火车站网站
  • 网站开发常用技术专业网站建设公司用织梦吗?
  • 做电影采集网站用什么vps国产企业wordpress
  • 免费个人二级域名网站做天猫还是做网站推广
  • 在线手机动画网站模板网站设置什么意思
  • 临沂做网站推广的公司哪家好教育类网站设计
  • 男女做的那个视频网站将自己的网站导入织梦
  • 阿里巴巴网站详情页怎么做的wordpress 滑块验证码
  • only网站建设分析建设工程公司名字大全
  • 网页制作官方网站尖叫直播
  • 虚拟主机如何建设多个网站wordpress term_group
  • 坪山网站建设哪家便宜四川企业网站模板步骤
  • 深圳专业网站建设网站备案包括哪些东西
  • wordpress总是跳出淘宝关键词分布中对seo有危害的
  • 备案的网站是公司吗肇庆seo外包