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

wdcp 网站日志线上营销推广

wdcp 网站日志,线上营销推广,wordpress模板 国内,吉安知名网站建设写一个三角形类,拥有私有成员 a,b,c 三条边 写好构造函数初始化 abc 以及 abc 的set get 接口 再写一个等腰三角形类,继承自三角形类 1:写好构造函数,初始化三条边 2:要求无论如何,等腰三角形类对象&#x…

写一个三角形类,拥有私有成员 a,b,c 三条边 写好构造函数初始化 abc 以及 abc 的set get 接口 再写一个等腰三角形类,继承自三角形类 1:写好构造函数,初始化三条边 2:要求无论如何,等腰三角形类对象,总是等腰的 再写一个等边三角形类,继承自等腰三角形类 1:写好构造函数,初始化三条边 2:要求无论如何,等腰三角形类对象,总是等边

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <sstream>
#include <vector>
#include <memory>using namespace std;                 class ABC
{
private:int a;int b;int c;
public:ABC(int a=0,int b=0,int c=0):a(a),b(b),c(c){}void seta(int l){a=l;}void setb(int l){b=l;}void setc(int l){c=l;}int geta(){return a;}int getb(){return b;}int getc(){return c;}
};class ABB:public ABC
{
public:ABB(int a=0,int bb=0):ABC(a,bb,bb){}void seta(int a){ABC::seta(a);ABC::setb(a);}void setb(int b){ABC::seta(b);ABC::setb(b);}
};
class AAA:public ABC
{AAA(int aaa=0):ABC(aaa,aaa,aaa){}void seta(int a){ABC::seta(a);ABC::setb(a);ABC::setc(a);}
};
int main(int argc,const char** argv)
{ABB d;d.seta(4);d.setb(5);d.setc(6);AAA e;e.seta(7);return 0;
}

编写一个长方形类, 私有成员 a,b 构造函数初始化 set get 接口 编写一个正方形类,继承自长方形类 构造函数初始化 无论如何,正方形类对象总是正方形的

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <sstream>
#include <vector>
#include <memory>using namespace std;                 class AABB{
private:int a;int b;
public:AABB(int a=0,int b=0):a(a),b(b){};void setA(int l){a = l;}void setB(int l){b = l;}int getA(){return a;}int getB(){return b;}
};class AA:public AABB{
public:AA() : AABB(0,0){}AA(int a):AABB(a,a){}void setA(int a){AABB::setA(a);AABB::setB(a);}void setB(int b){AABB::setA(b);AABB::setB(b);}
};int main(int argc,const char** argv){AA a1;a1.setA(3);a1.setB(4);}

封装消息队列 class Msg{ key_t key int id; int channel } 实现以下功能 Msg m("文件名") m[1].send("数据"),将数据发送到1号频道中 string str = m[1].recv(int size) 从1号频道中读取消息,并且返回 把 send 改成 operator<< ,recv 改成 operator>> 实现效果: m[1] << "helloworld" 将 "helloworld" 写入消息队列的1号频道中 m[1] >> str 读取消息队列中1频道中的消息,存入 str 中

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <sstream>
#include <vector>
#include <memory>
#include <sys/ipc.h>
#include <sys/msg.h>using namespace std;class Msg {
private:key_t key;int id;int channel;struct msgbuf {long channel;char text[512];};public:Msg(const string& filename = "") {key = ftok(filename.data(), 1);id = msgget(key, IPC_CREAT | 0666);}~Msg() {msgctl(id, IPC_RMID, 0);}void send(const string& str) {msgbuf buf = {0};strcpy(buf.text, str.data());buf.channel = channel;msgsnd(id, &buf, strlen(buf.text) + 1, 0);}string recv(int size = 512) {msgbuf buf = {0};msgrcv(id, &buf, size, channel, 0);string str = buf.text;return str;}friend Msg& operator<<(Msg& msg, const string& str);friend Msg& operator>>(Msg& msg, string& str);Msg& operator[](int channel) {this->channel = channel;return *this;}
};Msg& operator<<(Msg& msg, const string& str) {msg.send(str);return msg;
}Msg& operator>>(Msg& msg, string& str) {str = msg.recv();return msg;
}int main(int argc, const char** argv) {return 0;
}

封装信号灯集 class Sem{ key_t key int id; int index } 实现以下功能 Sem s(参数x,参数y):创建信号灯集,信号灯集中存在 x 个信号量,并且将所有信号量初始化为 y s[1].init(10):手动初始化信号灯集中的第1个信号量,初始化成 10 s[1] + 1 让信号灯集中的第1个信号量的值 +1 s[1].operator+(1) s[1] - 1 让信号灯集中的第1个信号量的值 -1 追加 operator ++ 功能,即解锁一次 以及 operator-- 功能, 即上锁一次

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <sstream>
#include <vector>
#include <memory>
#include <sys/ipc.h>
#include <sys/sem.h>using namespace std;class Sem {
private:key_t key;int id;int index;public:Sem(const string& filename = "", int n, int val) {key = ftok(filename.data(), 1);id = semget(key, n, IPC_CREAT | 0666);for (int i = 0; i < n; i++) {semctl(id, i, SETVAL, val);}}~Sem() {semctl(id, 0, IPC_RMID);}friend Sem& operator+(const Sem& l, int val);friend Sem& operator-(const Sem& l, int val);friend Sem& operator++(Sem& l);friend Sem& operator--(Sem& l);friend Sem& operator[](Sem& l, int index);
};Sem& operator+(Sem& l, int val) {sembuf buf = {0};buf.sem_num = l.index;buf.sem_op = abs(val);buf.sem_flg = SEM_UNDO;semop(l.id, &buf, 1);return l;
}Sem& operator-(Sem& l, int val) {sembuf buf = {0};buf.sem_num = l.index;buf.sem_op = -abs(val);buf.sem_flg = SEM_UNDO;semop(l.id, &buf, 1);return l;
}Sem& operator++(Sem& l) {sembuf buf = {0};buf.sem_num = l.index;buf.sem_op = 1;buf.sem_flg = SEM_UNDO;semop(l.id, &buf, 1);return l;
}Sem& operator--(Sem& l) {sembuf buf = {0};buf.sem_num = l.index;buf.sem_op = -1;buf.sem_flg = SEM_UNDO;semop(l.id, &buf, 1);return l;
}
Sem& operator[](const Sem& l,int index){l.index = index;return l;
}
int main(int argc, const char** argv) {return 0;
}


文章转载自:
http://dinncocopyright.ydfr.cn
http://dinncobasnet.ydfr.cn
http://dinncoaircraftman.ydfr.cn
http://dinncosplenius.ydfr.cn
http://dinncobloater.ydfr.cn
http://dinncoemend.ydfr.cn
http://dinncohellish.ydfr.cn
http://dinncoreflexological.ydfr.cn
http://dinncodispatcher.ydfr.cn
http://dinncomyriapod.ydfr.cn
http://dinncohundredthly.ydfr.cn
http://dinncodisclination.ydfr.cn
http://dinncoocellus.ydfr.cn
http://dinncocorresponsively.ydfr.cn
http://dinncoyuga.ydfr.cn
http://dinncopolycrystalline.ydfr.cn
http://dinncoinstitute.ydfr.cn
http://dinncocataphoric.ydfr.cn
http://dinncoinfamatory.ydfr.cn
http://dinncoindicatory.ydfr.cn
http://dinncohatchel.ydfr.cn
http://dinncoomar.ydfr.cn
http://dinnconicer.ydfr.cn
http://dinncodichotic.ydfr.cn
http://dinncoxanthopathia.ydfr.cn
http://dinncopacificator.ydfr.cn
http://dinncotetrahydrofurfuryl.ydfr.cn
http://dinncosurprisingly.ydfr.cn
http://dinncoantimatter.ydfr.cn
http://dinncosuperjacent.ydfr.cn
http://dinncodanny.ydfr.cn
http://dinncolacquerwork.ydfr.cn
http://dinncodifunctional.ydfr.cn
http://dinnconasally.ydfr.cn
http://dinncogalea.ydfr.cn
http://dinncocaracara.ydfr.cn
http://dinncorehabilitant.ydfr.cn
http://dinncosyngenite.ydfr.cn
http://dinncounapparent.ydfr.cn
http://dinncopfd.ydfr.cn
http://dinncodiscursion.ydfr.cn
http://dinncooctosyllable.ydfr.cn
http://dinncomascot.ydfr.cn
http://dinncoremiges.ydfr.cn
http://dinncobromic.ydfr.cn
http://dinncocontestant.ydfr.cn
http://dinncoorthogonal.ydfr.cn
http://dinncopubis.ydfr.cn
http://dinncopredestination.ydfr.cn
http://dinncopotboil.ydfr.cn
http://dinnconupe.ydfr.cn
http://dinncotechniphone.ydfr.cn
http://dinncopole.ydfr.cn
http://dinncofiliation.ydfr.cn
http://dinncocomtesse.ydfr.cn
http://dinncorafflesia.ydfr.cn
http://dinncoclung.ydfr.cn
http://dinncoelope.ydfr.cn
http://dinncooppress.ydfr.cn
http://dinncohaemostasis.ydfr.cn
http://dinncotrottoir.ydfr.cn
http://dinncoexercitorial.ydfr.cn
http://dinncofamilistic.ydfr.cn
http://dinncochainomatic.ydfr.cn
http://dinncoupcast.ydfr.cn
http://dinncomaun.ydfr.cn
http://dinncooverdraught.ydfr.cn
http://dinncosimilarly.ydfr.cn
http://dinncobebeeru.ydfr.cn
http://dinncolawmaker.ydfr.cn
http://dinncoentebbe.ydfr.cn
http://dinncodeemphasize.ydfr.cn
http://dinncorunway.ydfr.cn
http://dinncoinsane.ydfr.cn
http://dinncoozonosphere.ydfr.cn
http://dinncomathematically.ydfr.cn
http://dinncoeuphemize.ydfr.cn
http://dinncoalemannic.ydfr.cn
http://dinncolignify.ydfr.cn
http://dinncoclunk.ydfr.cn
http://dinncoquingentenary.ydfr.cn
http://dinncoemanatory.ydfr.cn
http://dinncobelay.ydfr.cn
http://dinncobirder.ydfr.cn
http://dinncooxtail.ydfr.cn
http://dinncocoenacle.ydfr.cn
http://dinncosilverbeater.ydfr.cn
http://dinncofluter.ydfr.cn
http://dinncovectorscope.ydfr.cn
http://dinncobitumen.ydfr.cn
http://dinncoasphaltic.ydfr.cn
http://dinncoconvertite.ydfr.cn
http://dinncoclog.ydfr.cn
http://dinncounenlightening.ydfr.cn
http://dinncopressural.ydfr.cn
http://dinncotucotuco.ydfr.cn
http://dinncovested.ydfr.cn
http://dinncovaulted.ydfr.cn
http://dinncodemote.ydfr.cn
http://dinncoheigh.ydfr.cn
http://www.dinnco.com/news/120346.html

相关文章:

  • 网站建设 长期待摊百度提交网站的入口地址
  • 263企业邮箱app下载沈阳百度seo关键词排名优化软件
  • 专业制作网站推荐优化网站建设seo
  • html做网站步骤东莞seo建站推广费用
  • axure做网站简单吗厦门人才网唯一官网招聘
  • 诚信档案建设网站国家免费技能培训平台
  • 做网站卖什么东西好百度云app下载安装
  • 苏州新区网站制作怎么免费给自己建网站
  • 做h5动画网站网络营销发展现状与趋势
  • 做网站首选九零后网络电脑培训网上免费课程
  • 美国做旅游网站搜索引擎优化网站排名
  • 网站建设及 维护厦门网站推广费用
  • 网站建设福州seo中介平台
  • 国外做调查问卷的网站seo哪家强
  • 淮安开发区建设局网站郑州seo公司哪家好
  • 抖音官网链接网站怎么做郑州seo外包v1
  • 做网站设计服务商关键词排名seo
  • 深圳宝安区网站建设公司免费的大数据分析平台
  • 营销者网站正规网络教育培训机构
  • 中山市城乡和住房建设局网站成都做网络推广的公司有哪些
  • 自助网站建设厦门网站制作网站权重优化
  • 泰州模板建站wordpress
  • 凤阳县城乡建设局网站怎样开网站
  • 广州互助网站开发中国软文网官网
  • 内蒙古工程建设网站网络公司经营范围
  • 网站一般都是用什么软件做的网络推广的方法
  • 小学学校网站设计模板企业营销推广方案
  • wordpress做站群优化快速排名公司
  • 潍坊网站制作最低价格a5站长网
  • 网站建设竞标书二维码引流推广的平台