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

怎样做音视频宣传网站数字营销案例

怎样做音视频宣传网站,数字营销案例,佛山市做网站,北京个人网站建设1、标准库的map类型 2、插入数据 #include <map> #include <string> #include <iostream>using namespace std;int main() {map<string, int> mapTest;// 插入到map容器内部的元素是默认按照key从小到大来排序// key类型一定要重载小于号<运算符map…

1、标准库的map类型

2、插入数据

#include <map>
#include <string>
#include <iostream>using namespace std;int main() {map<string, int> mapTest;// 插入到map容器内部的元素是默认按照key从小到大来排序// key类型一定要重载小于号<运算符mapTest["aaa"] = 100;  // int& operator[](const string& index);mapTest["eee"] = 500;  // 可以重新赋值,但是下面的用insert方法就不能重新赋值mapTest.insert(map<string, int>::value_type("bbb", 200));mapTest.insert(map<string, int>::value_type("bbb", 2000));mapTest.insert(pair<string, int>("ccc", 300));mapTest.insert(pair<string, int>("ccc", 3000));mapTest.insert(make_pair("ddd", 400));mapTest.insert(make_pair("ddd", 4000));map<string, int>::const_iterator it;for (it = mapTest.begin(); it != mapTest.end(); ++it){cout << it->first << " " << it->second << endl;}return 0;
}// 输出
aaa 100
bbb 200
ccc 300
ddd 400
eee 500

3、查找与修改

#include <map>
#include <string>
#include <iostream>using namespace std;int main() {map<string, int> mapTest;mapTest["aaa"] = 100;  // int& operator[](const string& index);mapTest.insert(map<string, int>::value_type("bbb", 200));mapTest.insert(pair<string, int>("ccc", 300));mapTest.insert(make_pair("ddd", 400));int n = mapTest["bbbc"];  // 这边如果找不到ket的值,还是会返回0,这样就不能判断有没有找到。所以得用限免的方式去查找cout << n << endl;mapTest["bbb"] = 2000;map<string, int>::iterator it;it = mapTest.find("ccc");if (it != mapTest.end()){it->second = 3000;}else{cout << "not found" << endl;}//    map<string, int>::const_iterator it;for (it = mapTest.begin(); it != mapTest.end(); ++it){cout << it->first << " " << it->second << endl;}return 0;
}// 输出
0
aaa 100
bbb 2000
bbbc 0
ccc 3000
ddd 400

4、删除

#include <map>
#include <string>
#include <iostream>using namespace std;int main() {map<string, int> mapTest;// 插入到map容器内部的元素是默认按照key从小到大来排序// key类型一定要重载小于号<运算符mapTest["aaa"] = 100;  // int& operator[](const string& index);mapTest.insert(map<string, int>::value_type("bbb", 200));mapTest.insert(pair<string, int>("ccc", 300));mapTest.insert(make_pair("ddd", 400));mapTest.erase("bbb");map<string, int>::const_iterator it;it = mapTest.find("ccc");if (it != mapTest.end()){mapTest.erase(it);}for (it = mapTest.begin(); it != mapTest.end(); ++it){cout << it->first << " " << it->second << endl;}return 0;
}// 输出
aaa 100
ddd 400

http://www.mmbaike.com/news/68473.html

相关文章:

  • 网站开发设计运维seo薪酬如何
  • 靠比较软件下载大全app网站市场营销十大经典案例
  • 泰安网站建设培训成都网站关键词推广优化
  • 网站建设 青少年宫学电脑培训班
  • 大连金州网站建设收录优美图片
  • iis7网站建设企业网络营销推广方法
  • 优科技网站建设东莞seo优化排名
  • 织梦做英文网站出现乱码西安网站建设
  • 如何预览做好的网站百度智能建站系统
  • 蒙阴网站优化百度关键词seo推广
  • 专业开发网站多少钱洛阳网站建设优化
  • 手机定位网站源码如何推广引流
  • 深圳企业网站建设设计公司企业seo职位
  • 二手东西网站怎么做艾滋病多长时间能查出来
  • 长春高铁建站看广告收益的正规平台
  • idea网站开发竞价推广托管开户
  • 金融网站怎么做的厦门seo推广
  • 网站优化营销公司优化网哪个牌子好
  • 重庆自适应网站建设整合营销名词解释
  • 长沙高端网站制作公司网站设计规划
  • 网站改版上线手机百度搜索引擎
  • 网站运营推广难做吗营销新闻
  • 问卷调查网站哪个好推广商
  • 郑州网站建设公司steam交易链接怎么改
  • 做一款网站营销图片大全
  • 怀化网站开发关键词优化推广排名多少钱
  • 网站注册账号有风险吗产品软文
  • 电子商务网站开发原则推广论坛有哪些
  • 中国工程建设标准化网站阿里指数怎么没有了
  • wordpress 怎么启动seo都用在哪些网站