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

公司网站制作要多少钱朋友圈转wordpress文章显示缩略图

公司网站制作要多少钱,朋友圈转wordpress文章显示缩略图,茂名seo网站推广,青岛开发网站实现一个图形类(Shape),包含受保护成员属性:周长、面积, 公共成员函数:特殊成员函数书写 定义一个圆形类(Circle),继承自图形类,包含私有属性:半…

实现一个图形类(Shape),包含受保护成员属性:周长、面积,

公共成员函数:特殊成员函数书写

定义一个圆形类(Circle),继承自图形类,包含私有属性:半径

公共成员函数:特殊成员函数、以及获取周长、获取面积函数

定义一个矩形类(Rect),继承自图形类,包含私有属性:长度、宽度

公共成员函数:特殊成员函数、以及获取周长、获取面积函数

在主函数中,分别实例化圆形类对象以及矩形类对象,并测试相关的成员函数。

#include <iostream>using namespace std;
class Shape
{
protected:double round;double area;
public:Shape(){cout<<"无参构造"<<endl;}Shape(double r,double a):round(r),area(a){cout<<"有参构造"<<endl;}~Shape(){cout<<"析构函数"<<endl;}Shape(const Shape &other):round(other.round),area(other.area){cout<<"拷贝构造"<<endl;}Shape & operator=(const Shape &other){this->area=other.area;this->round=other.round;cout<<"拷贝赋值"<<endl;return *this;}Shape & operator=(Shape &&other){this->area=other.area;this->round=other.round;cout<<"移动赋值"<<endl;return *this;}};
class Circle:public Shape
{
private:double bj;
public:Circle() {}Circle(double r):bj(r){cout<<"有参构造"<<endl;}~Circle(){cout<<"析构函数"<<endl;}Circle(const Circle &other):Shape(other.round,other.area),bj(other.bj){cout<<"拷贝构造"<<endl;}Circle & operator=(const Circle &other){this->area=other.area;this->round=other.round;this->bj=other.bj;cout<<"拷贝赋值"<<endl;return *this;}Circle & operator=(Circle &&other){this->area=other.area;this->round=other.round;this->bj=other.bj;cout<<"移动赋值"<<endl;return *this;}void zc(){this->round=this->bj*2*(3.14);cout<<"周长="<<round<<endl;}void mj(){this->area=this->bj*this->bj*(3.14);cout<<"面积="<<area<<endl;}void show(){cout<<"周长="<<round<<endl;cout<<"面积="<<area<<endl;}
};
class Rect:public Shape
{
private:double hight;double wight;
public:Rect() {}Rect(double h,double w):hight(h),wight(w){cout<<"有参构造"<<endl;}~Rect(){cout<<"析构函数"<<endl;}Rect(const Rect &other):Shape(other.round,other.area),hight(other.hight),wight(other.wight){cout<<"拷贝构造"<<endl;}Rect & operator=(const Rect &other){this->area=other.area;this->round=other.round;this->hight=other.hight;this->wight=other.wight;cout<<"拷贝赋值"<<endl;return *this;}Rect & operator=(Rect &&other){this->area=other.area;this->round=other.round;this->hight=other.hight;this->wight=other.wight;cout<<"移动赋值"<<endl;return *this;}void zc(){this->round=(this->hight+this->wight)*2;cout<<"周长="<<round<<endl;}void mj(){this->area=this->hight*this->wight;cout<<"面积="<<area<<endl;}void show(){cout<<"周长="<<round<<endl;cout<<"面积="<<area<<endl;}
};
int main()
{Circle c1(10);c1.zc();c1.mj();Circle c2(c1);c2.show();Circle c3;c3=c1;c3.show();Circle c4;c4=move(c3);c3.show();c4.show();cout<<"******************************************"<<endl;Rect r1(10,5);r1.mj();r1.zc();Rect r2=r1;r2.show();Rect r3;r3=r1;r3.show();return 0;
}

http://www.yayakq.cn/news/928770/

相关文章:

  • 官网站内优化怎么做 2018wordpress插件怎么破解
  • 订阅号可以做网站么网站建设上市公司
  • seo网站推广作用邯郸二手房出售信息
  • 网站和网页不同吗企业信息系统包括
  • 手机版网站如何建设国家住建网查企业资质
  • 一个公司做几个网站网站logo替换
  • 广东响应式网站杭州网站建设商业
  • 装饰公司怎么做网站公司展示型网站
  • 广安 网站建设自己怎么制作图片
  • 网站导航二级菜单怎么做出来的公司装修效果图办公室
  • 汽车网站制作模板大型网站 网站建设
  • 武安网站制作淮安网站建设哪家好
  • 大会的网站架构如何推广外贸型网站
  • 网站开发 合同范本移动端开发需要学什么
  • 江西住房和城乡建设部网站首页中国央企100强排名
  • 龙华个人网站建设seop
  • 建域名网站需要多少钱天津平台网站建设哪家好
  • 常州哪家网站建设公司专业静态摄影网站模板
  • 深圳找工作哪个网站好网页设计常见的布局形式
  • 网站建设实训分析总结网站管理系统制作
  • 网站智能建设有那些优势零下一度网站建设
  • dz门户做视频网站红河公司 网站建设
  • 河南省水利建设厅网站wordpress硬件条件
  • 电商网站系统wordpress 改登录界面
  • 贵阳培训网站建设Wordpress竞拍
  • 互动网站建设外贸网站模板建立
  • 如何做好一个百度竞价网站吴桥县网站建设
  • php做网站访问记录中国战略咨询公司排名
  • 成都市成华区建设局官方网站如何在百度推广
  • 网站提示404errorwordpress 注册 登录界面