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

如何做搞笑原创视频网站深圳室内设计公司排行

如何做搞笑原创视频网站,深圳室内设计公司排行,智能自助建站系统源码,设计师培训学校排行榜模拟一个游戏场景 有一个英雄#xff1a;初始所有属性为1 atk,def,apd,hp 游戏当中有以下3种武器 长剑Sword#xff1a; 装备该武器获得 1atx#xff0c;1def 短剑Blade#xff1a; 装备该武器获得 1atk#xff0c;1spd 斧头Axe#xff1a; 装备该… 模拟一个游戏场景     有一个英雄初始所有属性为1     atk,def,apd,hp 游戏当中有以下3种武器     长剑Sword 装备该武器获得 1atx1def     短剑Blade 装备该武器获得 1atk1spd     斧头Axe   装备该武器获得 1atk1hp 要求英雄写一个函数     equipweapon 装备武器     实现效果装备不同武器英雄获得不同的属性加成 /*有一个英雄初始所有属性为1 atk,def,spd,hp 游戏当中有以下3种武器 长剑Sword装备该武器获得1atk1def 短剑Blade装备该武器获得1atk1spd 斧头Axe装备该武器获得1atk1hp*/ #include iostreamusing namespace std; class Hero; class Weapon { public:int atk;Weapon():atk(1){}virtual void update(Hero h);int get_atk1();virtual ~Weapon(){} };class Sword:public Weapon {int def; public:Sword():def(1){}void update(Hero h); };class Blade:public Weapon {int spd; public:Blade():spd(1){}void update(Hero h); };class Aex:public Weapon {int hp; public:Aex():hp(1){}void update(Hero h); };class Hero {int atk;int def;int spd;int hp;public:Hero():atk(1),def(1),spd(1),hp(1){}void set_atk(int atk);void set_def(int def);void set_spd(int spd);void set_hp(int hp);int get_atk();int get_def();int get_spd();int get_hp();void updateWeapon(Weapon *w);void show(); }; void Hero::set_atk(int atk) {this-atkatk; } void Hero::set_def(int def) {this-defdef; } void Hero::set_spd(int spd) {this-spdspd; } void Hero::set_hp(int hp) {this-hphp; } int Hero::get_atk() {return this-atk; } int Hero::get_def() {return this-def; } int Hero::get_spd() {return this-spd; } int Hero::get_hp() {return this-hp; } void Weapon::update(Hero h) {int new_atkh.get_atk()this-atk;h.set_atk(new_atk); }void Sword::update(Hero h) {Weapon::update(h);int new_defh.get_def()this-def;h.set_def(new_def); }void Blade::update(Hero h) {Weapon::update(h);int new_spdh.get_spd()this-spd;h.set_spd(new_spd); }void Aex::update(Hero h) {Weapon::update(h);int new_hph.get_hp()this-hp;h.set_hp(new_hp); } void Hero::updateWeapon(Weapon *w) {w-update(*this);delete w; } void Hero::show() {coutatkatkendl;coutdefdefendl;coutspdspdendl;couthphpendl; } int main() {Hero h1,h2,h3;h1.updateWeapon(new Sword);h2.updateWeapon(new Blade);h3.updateWeapon(new Aex);h1.show();h2.show();h3.show();return 0; }
http://www.yingshimen.cn/news/123588/

相关文章:

  • 南通企业建站系统模板广告设计主要做什么
  • 网站漂浮代码wordpress5.2
  • 网站制作尺寸电子商务网站建设与管理是什么
  • 推广网站的形式包括广告设计公司英文介绍
  • 虚拟商城网站搭建网站开发项目质量控制措施
  • 国家化妆品备案网官网济南网站优化建设
  • 龙岗网站推广网站建设5iec
  • 微网站怎么用手机网站建设培训
  • 怎么查网站的注册信息wordpress搬家lnmp
  • 免费送的广告怎么在网站上做站长工具爱站
  • 网站管理员密码忘记了怎么办苏州手机关键词优化
  • 遵义住房和城乡建设局网站seo基础知识培训视频
  • 网站安全检测在线网站建设哪家好就推 鹏博资讯
  • 龙海网站定制企业网站建设费用记入
  • 网站推广页面 英语百度收录时间
  • 网站建设与网页设计的论文做网站售后几年
  • 江门做网站多少钱wordpress exp
  • 新网站怎样做优化郴州网站开发公司
  • 简单的网站代码手机编辑个人简历
  • 国际网站怎么做优化阿里云网站备案注销吗
  • 做招聘网站的客户想退钱企业crm客户管理系统
  • 网站编程论文网站换模板有影响吗
  • wordpress 文章回收站网站开发环境配置
  • 网站免费注册会员怎么做自己建网站做外贸
  • wordpress 插件 块google关键词优化
  • 山西省两学一做网站西安seo关键词排名优化
  • 嘉兴推广网站网站搭建免费软件
  • 的网站设计案例郑州网站定制
  • 定制网站开发的目的是什么vs2017 网站开发环境
  • 网站开发设计公司简介如何建设一个自己 的网站