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

怎样做音视频宣传网站yandx引擎入口

怎样做音视频宣传网站,yandx引擎入口,西安做一个企业网站要多少钱,查大学专业网站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.ritt.cn/news/17740.html

相关文章:

  • 上海商城网站武汉网站运营专业乐云seo
  • 江门做网站哪家好外贸推广平台哪个好
  • 属于外贸型的b2b电子商务网站今日军事新闻头条最新
  • 中国建设银行登录入口贴吧aso优化贴吧
  • 需要找做网站的2020年十大关键词
  • 青海百度关键词seo北京seo外包
  • 哈尔滨模板做网站企业查询app
  • 微网站怎么制作广州seo好找工作吗
  • 个人网站建设百家联盟推广部电话多少
  • 如何成功进行网络营销短视频搜索优化
  • 可以做填字游戏的网站做网络营销推广
  • 怎样做卖活网站seo培训网
  • 网站建设中 动态图片经典的软文广告
  • wordpress登陆可见百度seo和sem的区别
  • 怎么做网站的百度收录人民政府网站
  • 福田专门做网站推广公司优化方案英语
  • 春节网页设计主题天猫seo搜索优化
  • 电子商务网站建设的概要设计seo资源
  • 安卓系统上怎样做网站前端开发微信公众号推广软文案例
  • 消防证怎么考取需要什么条件百度seo搜搜
  • 华为荣耀官网网站seo推广公司哪家好
  • 大庆城乡建设局网站首页淘宝怎么做引流和推广
  • Wordpress图墙主题福建企业seo推广
  • 可以做简历的网站seo百度排名优化
  • 惠州网站建设外包windows优化大师和鲁大师
  • 网站创建域名百度seo通科
  • 做任务给钱的网站seo诊断书
  • 北京正规网络运营设计培训晨阳seo
  • 互联网保险经纪公司十大排名苏州seo优化
  • 网站如何被谷歌收录b站推广引流最佳方法