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

小企业网站建设一般收费wordpress 制作portfolio

小企业网站建设一般收费,wordpress 制作portfolio,上海排名优化工具价格,湖南省水运建设投资集团网站定义一个Person类#xff0c;私有成员int age#xff0c;string name#xff0c;定义一个Stu类#xff0c;包含私有成员double *score#xff0c;写出两个类的构造函数、析构函数、拷贝构造和拷贝赋值函数#xff0c;完成对Person的运算符重载(算术运算符、条件运算… 定义一个Person类私有成员int agestring name定义一个Stu类包含私有成员double *score写出两个类的构造函数、析构函数、拷贝构造和拷贝赋值函数完成对Person的运算符重载(算术运算符、条件运算符、逻辑运算符、自增自减运算符、插入/提取运算符) #include iostream using namespace std;class Person {int age;string name; public://构造函数void show();void show1();Person(string a):name(a){}Person(int a,string b):age(a),name(b){}//拷贝构造函数Person(const Person other):age(other.age),name(other.name){}//拷贝赋值函数Person operator(const Person other){this-ageother.age;this-nameother.name;return *(this);}//算数运算符Person operator(Person other);//类内定义friend Person operator(Person a1,Person a2);//类外定义Person operator-(Person other);//类内定义friend Person operator-(Person a1,Person a2);//类外定义Person operator*(Person other);//类内定义friend Person operator*(Person a1,Person a2);//类外定义Person operator/(Person other);//类内定义friend Person operator/(Person a1,Person a2);//类外定义Person operator%(Person other);//类内定义friend Person operator%(Person a1,Person a2);//类外定义//条件运算符bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator!(Person other);//类内定义friend bool operator!(Person a1,Person a2);//类外定义//逻辑运算符bool operator(Person other);//类内定义friend bool operator(Person a1,Person a2);//类外定义bool operator||(Person other);//类内定义friend bool operator||(Person a1,Person a2);//类外定义//自增自减运算符Person operator(int);//类内定义后置friend Person operator(Person other,int);//类外定义后置Person operator();//类内定义前置friend Person operator(Person other);//类外定义前置Person operator--(int);//类内定义后置friend Person operator--(Person other,int);//类外定义后置--Person operator--();//类内定义前置--friend Person operator--(Person other);//类外定义前置--//插入提取运算符friend ostream operator(ostream out,Person other);friend istream operator(istream in,Person other);//析构函数~Person(){} };class Stu {double *score; public:void show();//构造函数Stu(){}Stu(double score):score(new double(score)){}//拷贝构造函数Stu(const Stu other):score(new double(*other.score)){}//拷贝赋值函数Stu operator(const Stu other){*(this-score) *(other.score);return (*this);}//析构函数~Stu(){} };void Person::show() {cout age age endl;cout name name endl; } void Person::show1() {cout age age endl; }void Stu::show() {cout *score *score endl; }Person Person::operator(Person other) {string str(zhangsan);Person temp(str);temp.agethis-ageother.age;//temp.namethis-nameother.name;return temp; } Person operator(Person a1,Person a2) {string str(aaa);Person temp(str);temp.agea1.agea2.age;//temp.namea1.namea2.name;return temp; } Person Person::operator-(Person other) {string str(zhangsan);Person temp(str);temp.agethis-age-other.age;//temp.namethis-nameother.name;return temp; } Person operator-(Person a1,Person a2) {string str(aaa);Person temp(str);temp.agea1.age-a2.age;//temp.namea1.namea2.name;return temp; } Person Person::operator*(Person other) {string str(zhangsan);Person temp(str);temp.agethis-age*other.age;//temp.namethis-nameother.name;return temp; } Person operator*(Person a1,Person a2) {string str(aaa);Person temp(str);temp.agea1.age*a2.age;//temp.namea1.namea2.name;return temp; } Person Person::operator/(Person other) {string str(zhangsan);Person temp(str);temp.agethis-age/other.age;//temp.namethis-nameother.name;return temp; } Person operator/(Person a1,Person a2) {string str(aaa);Person temp(str);temp.agea1.age/a2.age;//temp.namea1.namea2.name;return temp; } Person Person::operator%(Person other) {string str(zhangsan);Person temp(str);temp.agethis-age%other.age;//temp.namethis-nameother.name;return temp; } Person operator%(Person a1,Person a2) {string str(aaa);Person temp(str);temp.agea1.age%a2.age;//temp.namea1.namea2.name;return temp; }bool operator(Person a1,Person a2) {return a1.age a2.age;} bool Person::operator(Person a1) {return this-age a1.age; } bool operator(Person a1,Person a2) {return a1.age a2.age;} bool Person::operator(Person a1) {return this-age a1.age; } bool operator(Person a1,Person a2) {return a1.age a2.age;} bool Person::operator(Person a1) {return this-age a1.age; } bool operator(Person a1,Person a2) {return a1.age a2.age;} bool Person::operator(Person a1) {return this-age a1.age; } bool operator(Person a1,Person a2) {return a1.age a2.age;} bool Person::operator(Person a1) {return this-age a1.age; } bool operator!(Person a1,Person a2) {return a1.age ! a2.age;} bool Person::operator!(Person a1) {return this-age a1.age; }bool Person::operator(Person other) {return this-age other.age; } bool operator(Person a1,Person a2) {return a1.age a2.age; } bool Person::operator||(Person other) {return this-age || other.age; } bool operator||(Person a1,Person a2) {return a1.age || a2.age; }Person Person::operator(int) {string strzhangsan;Person temp(str);temp.age this-age;return temp; }Person operator(Person other,int) {string strzhangsan;Person temp(str);temp.ageother.age;return temp; } Person Person::operator() {(this-age);return (*this); } Person operator(Person other) {(other.age);return other; } Person Person::operator--(int) {string strzhangsan;Person temp(str);temp.age this-age--;return temp; }Person operator--(Person other,int) {string strzhangsan;Person temp(str);temp.ageother.age--;return temp; } Person Person::operator--() {--(this-age);return (*this); } Person operator--(Person other) {--(other.age);return other; }ostream operator(ostream out,Person other) {out other.age endl;return out; } istream operator(istream out,Person other) {out other.age;return out; }int main() {cout ---person构造函数--- endl;string strshangsan;Person a1(1,str);a1.show();cout ---person拷贝构造函数--- endl;Person a2a1;a2.show();cout ---person拷贝赋值函数--- endl;Person a3(str);a3a1;a3.show();cout ---Stu构造函数--- endl;Stu b1(100);b1.show();cout ---stu拷贝构造函数--- endl;Stu b2b1;b2.show();cout ---stu拷贝赋值函数--- endl;Stu b3;b3b1;b3.show();string str1(hello);string str2( world);Person a4(10,str1);Person a5(50,str2);Person a6operator(a4,a5);a6.show1();a6operator-(a4,a5);a6.show1();a6operator*(a4,a5);a6.show1();a6operator/(a4,a5);a6.show1();a6operator%(a4,a5);a6.show1();bool c1operator(a4,a5);bool c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator(a4,a5);c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator(a4,a5);c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator(a4,a5);c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator(a4,a5);c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator!(a4,a5);c2a4.operator!(a5);cout c1 c1 endl;cout c2 c2 endl;c1operator(a4,a5);c2a4.operator(a5);cout c1 c1 endl;cout c2 c2 endl;cout aaaa endl;Person a7a4.operator();a7.show1();a7operator(a4);a7.show1();a7a5.operator(10);a7.show1();a7operator(a5,10);a7.show1();a7a4.operator--();a7.show1();a7operator--(a4);a7.show1();a7a5.operator--(10);a7.show1();a7operator--(a5,10);a7.show1();couta4 a5 endl;operator(cout,a4);operator(cout,a5);Person a8(str);cina8;a8.show1();operator(cin,a8);a8.show1();return 0; }
http://www.pierceye.com/news/922409/

相关文章:

  • 中建铁路建设有限公司网站微信群营销工具
  • 单位网站建设意见建议百度关键词检测工具
  • 重庆网站建设方案书免费网上咨询医生是哪个网
  • 临沂市开发区可以做分销的网站网络域名综合查询
  • 建设银行企业网银网站过期银州手机网站建设
  • 导航网站 win8风格企业服务官网
  • 樟树有哪几个网站做爆药库在线制作图片视频生成器
  • 汕头网站定制青年汇网站开发公司
  • 厦门专业网站设计公司防控措施持续优化
  • wordpress子网站杭州化工网站建设
  • 怎样做网站 - 百度兰州家政公司
  • 网站上的字体大小福建省建设注册执业管理中心网站
  • 七台河做网站手机wap浏览器
  • 最新手机网站推荐哪个推广平台效果好
  • 百度官方网站关键词营销seo
  • 网站建设开发流程做网站的毕业设计
  • 网站模块wordpress图片多选
  • 济源市住房和城乡建设局网站公示聊城市城乡建设部网站查询
  • 阿里网 网站备案流程长春公司网站建设
  • 临沂做商城网站设计网站设计 线框图 怎么画
  • 台江网站建设建设网站的意义
  • 西安做网站公司报价沧州
  • 有了网站 怎么做排名优化企业黄页官网
  • 临夏州建设银行网站深圳官网
  • 手机互动网站建设昆山网络公司哪家比较好
  • 桐城网站建设推荐做网站的公司
  • 中国 网站服务器 租金手机免费网址
  • php网站如何做多语言网站域名有效期
  • 企业网站开发周期公司建设网站的作用
  • 惠普电脑网站建设策划方案蒙自做网站的公司