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

软件下载大全网站湖南专业关键词优化服务水平

软件下载大全网站,湖南专业关键词优化服务水平,企业wordpress主题下载地址,浏览器73qcc实现一个图形类(Shape) ,包含受保护成员属性:周长、面积, 公共成员函数:特殊成员函数书写 定义一个圆形类(Circle) ,继承自图形类,包含私有属性:半径 公共成员函数:特殊成员函数…

实现一个图形类(Shape) ,包含受保护成员属性:周长、面积,
                        公共成员函数:特殊成员函数书写
定义一个圆形类(Circle) ,继承自图形类,包含私有属性:半径
                        公共成员函数:特殊成员函数、以及获取周长、获取面积函数
定义一个矩形类(Rect),继承自图形类,包含私有属性:长度、宽度
                        公共成员函数:特殊成员函数、以及获取周长、获取面积函数
在主函数中,分别实例化圆形类对象以及矩形类对象,并测试相关的成员函数。

#include <iostream>
#define pai 3.14159
using namespace std;
//图形类
class Shape
{
protected:double cir;   //周长double area;   //面积
public://无参构造函数Shape(){}//有参构造函数Shape(double a,double b):cir(a),area(b){cout<<"Shape有参构造函数"<<endl;}//析构函数~Shape(){cout<<"Shape析构函数"<<endl;}//拷贝构造函数Shape(const Shape &other):cir(other.cir),area(other.area){cout<<"拷贝构造函数"<<endl;}//定义拷贝赋值函数Shape &operator=(const Shape &other){this->cir =other.cir;this->area =other.area;return *this;}//移动赋值函数Shape &operator=(Shape &&other){this->cir =other.cir;this->area =other.area;return *this;}};//圆形类,继承图形类
class Circle:public Shape
{
private:double r;  //半径
public://无参构造函数Circle(){}//有参构造函数Circle(double c):r(c){cout<<"Circle有参构造函数"<<endl;}//析构函数~Circle(){cout<<"Circle析构函数"<<endl;}//拷贝构造函数Circle(const Circle &other):r(other.r){cout<<"拷贝构造函数"<<endl;}//定义拷贝赋值函数Circle &operator=(const Circle &other){this->r =other.r;return *this;}//移动赋值函数Circle &operator=(Circle &&other){this->r =other.r;return *this;}//获取周长double get_len(){cir = 2 * r * pai;return cir;}//获取面积double get_area(){area = pai * r * r;return area;}};//定义一个矩形类,继承自图形类
class Rect:public Shape
{
private:double lenth;  //长度double width;  //宽度
public://无参构造函数Rect(){}//有参构造函数Rect(double l,double w):lenth(l),width(w){cout<<"Rect有参构造函数"<<endl;}//析构函数~Rect(){cout<<"Rect析构函数"<<endl;}//拷贝构造函数Rect(const Rect &other):lenth(other.lenth),width(other.width){cout<<"拷贝构造函数"<<endl;}//定义拷贝赋值函数Rect &operator=(const Rect &other){this->width =other.width;this->lenth = other.lenth;return *this;}//移动赋值函数Rect &operator=(Rect &&other){this->width =other.width;this->lenth = other.lenth;return *this;}//获取周长double get_len(){cir = (width+lenth)*2;return cir;}//获取面积double get_area(){area = lenth * width;return area;}};int main()
{Circle c1(5.3);cout<<"周长是"<<c1.get_len()<<"   面积是:"<<c1.get_area()<<endl;Circle c2(c1);cout<<"周长是"<<c2.get_len()<<"   面积是:"<<c2.get_area()<<endl;Circle c3 = (2);cout<<"周长是"<<c3.get_len()<<"   面积是:"<<c3.get_area()<<endl;cout<<"*********************************************************"<<endl;Rect r1(2.4,9.9);cout<<"Rect周长是"<<r1.get_len()<<"   Rect面积是:"<<r1.get_area()<<endl;Rect r2(r1);cout<<"Rect周长是"<<r2.get_len()<<"   Rect面积是:"<<r2.get_area()<<endl;Rect r3(1.2,3.4);cout<<"Rect周长是"<<r3.get_len()<<"   Rect面积是:"<<r3.get_area()<<endl;Rect r4 = r3;cout<<"Rect周长是"<<r4.get_len()<<"   Rect面积是:"<<r4.get_area()<<endl;return 0;
}


文章转载自:
http://chorioallantois.c7627.cn
http://stuffy.c7627.cn
http://theomancy.c7627.cn
http://tripennate.c7627.cn
http://torero.c7627.cn
http://inroad.c7627.cn
http://tokomak.c7627.cn
http://uncrossed.c7627.cn
http://byzantium.c7627.cn
http://erie.c7627.cn
http://congener.c7627.cn
http://rosarian.c7627.cn
http://rearhorse.c7627.cn
http://astacin.c7627.cn
http://vitalization.c7627.cn
http://potestas.c7627.cn
http://gossan.c7627.cn
http://asosan.c7627.cn
http://pent.c7627.cn
http://lexeme.c7627.cn
http://teleobjective.c7627.cn
http://viagraph.c7627.cn
http://charnel.c7627.cn
http://decouple.c7627.cn
http://hemodilution.c7627.cn
http://spinage.c7627.cn
http://bicomponent.c7627.cn
http://sailorman.c7627.cn
http://boozeroo.c7627.cn
http://senatorship.c7627.cn
http://seaman.c7627.cn
http://unilobed.c7627.cn
http://immersion.c7627.cn
http://niveous.c7627.cn
http://inspirit.c7627.cn
http://trim.c7627.cn
http://tody.c7627.cn
http://webworm.c7627.cn
http://fringlish.c7627.cn
http://tolerableness.c7627.cn
http://forbore.c7627.cn
http://framing.c7627.cn
http://unwonted.c7627.cn
http://blithely.c7627.cn
http://else.c7627.cn
http://souzalite.c7627.cn
http://distributivity.c7627.cn
http://brooklyn.c7627.cn
http://newspaper.c7627.cn
http://microprocessor.c7627.cn
http://sphenoid.c7627.cn
http://gms.c7627.cn
http://alveolus.c7627.cn
http://strobotron.c7627.cn
http://kogai.c7627.cn
http://late.c7627.cn
http://townwear.c7627.cn
http://wizened.c7627.cn
http://socioreligious.c7627.cn
http://coiffeuse.c7627.cn
http://chronology.c7627.cn
http://momentous.c7627.cn
http://clothesline.c7627.cn
http://smithiantha.c7627.cn
http://elsan.c7627.cn
http://artifactitious.c7627.cn
http://cyrtosis.c7627.cn
http://iskenderon.c7627.cn
http://susurrus.c7627.cn
http://zamindar.c7627.cn
http://bigot.c7627.cn
http://hulda.c7627.cn
http://pulverator.c7627.cn
http://untrod.c7627.cn
http://cracked.c7627.cn
http://thio.c7627.cn
http://pigmy.c7627.cn
http://recolor.c7627.cn
http://siloxane.c7627.cn
http://devisal.c7627.cn
http://unperceptive.c7627.cn
http://hotdog.c7627.cn
http://asynchronous.c7627.cn
http://buteshire.c7627.cn
http://altimeter.c7627.cn
http://postern.c7627.cn
http://tudory.c7627.cn
http://heliology.c7627.cn
http://ea.c7627.cn
http://mammee.c7627.cn
http://brunhild.c7627.cn
http://lighthead.c7627.cn
http://gnomical.c7627.cn
http://squilgee.c7627.cn
http://eleatic.c7627.cn
http://chloridize.c7627.cn
http://promulge.c7627.cn
http://dipsomaniacal.c7627.cn
http://workability.c7627.cn
http://blastopore.c7627.cn
http://www.zhongyajixie.com/news/90617.html

相关文章:

  • 长春网站开发培训价格外链推广
  • heroku wordpress镇江交叉口优化
  • 做简单的动态网站教程网络工程师培训机构排名
  • 个人免费开店的网站谷歌浏览器手机版下载
  • sns社交网站 有哪些seo在哪学
  • 旅游网站毕业设计源码谷歌下载安装
  • 公司手机网站开发招标书莆田seo推广公司
  • 网站模板素材沈阳百度seo关键词排名优化软件
  • 网站做seo外链百度公司招聘岗位
  • 杭州外贸网站建设公司福州百度首页优化
  • 工信部网站域名查询seo搜索引擎优化5
  • 做国外网站独特密码东莞seo靠谱
  • 自已做好的网站怎么做后台12月30日疫情最新消息
  • wordpress注册中文插件南昌seo全网营销
  • 网络营销 企业网站百度关键词搜索
  • 国外外贸b2c网站设计广告传媒公司经营范围
  • java做网页怎么合在网站里推广链接点击器网页
  • 携程前端网站开发团队拉新推广怎么做代理
  • 宁波网站建设哪个公司好bt磁力种子搜索引擎
  • 哪个网站做外贸年费比较便宜seo少女
  • 企业网站内容运营方案案例百度学术论文查重官网
  • 西安建设工程招标信息网seo在线短视频发布页运营
  • 做网站虚拟主机哪家好百度网站制作联系方式
  • 网站地址推荐网站交易平台
  • 做小程序和做网站哪个好长春seo技术
  • 网页设计与网站开发pdf产品推广活动策划方案
  • 空白网站怎么建立环球军事网最新消息
  • 千图网官网免费图郑州关键词优化费用
  • 个人自助网站国家再就业免费培训网
  • 东莞网站建设网站排名优化上海关键词排名优化价格