C++Primer第五版 练习11.24(解答)
来源:互联网 发布:ubuntu 休眠设置 编辑:程序博客网 时间:2024/06/16 20:13
练习11.24:下面的程序完成什么功能?
map<int,int> m;m[0] = 1;
答:找到关键字为0的元素,将其mapped_value赋值为1
/**2015/10/10*C++Primer第五版*11.3.4节练习 *练习11.24*问题描述:练习11.24:下面的程序完成什么功能?map<int,int> m;m[0] = 1;*说明: 将关键字为0的这个元素,值5变成1*作者:Nick Feng*邮箱:nickgreen23@163.com */ #include <iostream>#include <vector>#include <map>using namespace std;int main(){ map<int,int> m1 = {{0,5},{1,1},{2,2},{3,3}}; for(auto &m : m1) cout << m.first << " " << m.second << "..."; cout << endl; m1[0] = 1;//将关键字为0的这个元素,值5变成1 for(auto &m : m1) cout << m.first << " " << m.second << "..."; cout << endl; return 0; }
0 0
- C++Primer第五版 练习11.24(解答)
- C++Primer 第五版 练习9.43 解答
- C++Primer 第五版 练习10.12解答
- C++Primer第五版 练习10.32解答
- C++Primer第五版 1.2节练习(解答)
- C++Primer第五版 练习11.3(解答)
- C++Primer第五版 练习11.4(解答)
- C++Primer第五版 练习11.7(解答)
- C++Primer第五版 练习11.8(解答)
- C++Primer第五版 练习11.9(解答)
- C++Primer第五版 练习11.10(解答)
- C++Primer第五版 练习11.11(解答)
- C++Primer第五版 11.2.3节练习(解答)
- C++Primer第五版 练习11.12(解答)
- C++Primer第五版 练习11.13(解答)
- C++Primer第五版 练习11.14(解答)
- C++Primer第五版 练习11.16(解答)
- C++Primer第五版 练习11.17(解答)
- UILable , Button
- 地图中坐标转换的那些事儿
- VMware中安装VMware Tools
- 项目____form提交数据,action中接收相关(含ID NAME区别及用法)
- matlab自带的分类器对人脸、鼻子、嘴进行检测
- C++Primer第五版 练习11.24(解答)
- Delphi XE7 开发Android对话框方式
- @Autowired使用中的问题及@Qualifire的使用
- [转载]jQuery学习之prop和attr的区别
- linux 内核与用户空间通信之netlink使用方法
- nginx proxy超时报错 upstream timed out (110: Connec...
- [IOS 开发] AFNetworking2.2 setReachabilityStatusChangeBlock检测网络连接状态
- AFNetworking2.0源码解析<二>
- C++Primer第五版 练习11.25(解答)