STL map的遍历与pair的使用
2016-04-24 17:26
489 查看
#include <iostream> #include <unordered_map> using namespace std; int main(){ //map的遍历 unordered_map<int, int> a; a[1] = 4; a[3] = 5; a[2] = 6; for (unordered_map<int, int>::iterator it = a.begin(); it != a.end(); ++it){ cout << it->first << " " << it->second << endl; } //pair类 pair<int, int> my_pair; my_pair = make_pair(-9, 9); int ttt = 0; return 0; }
相关文章推荐
- 生产者消费者模型——wait/notify/notifyAll使用
- BNU 51640 Training Plan DP
- Airbase-ng帮助
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- Failure to transfer org.apache.maven.plugins:maven-war-plugin:pom:2.2 from https://repo.maven.apache
- init done opengl support available
- 172. Factorial Trailing Zeroes
- HDU 2389 Rain on your Parade (HK二分图)
- rt3070无线网卡工作在staion模式----fl2440开发板
- leetcode-217. Contains Duplicate
- 5、Jenkins Email Extension Plugin插件使用说明
- hdu3487Play with Chain【splay】
- 计算机视觉和人工智能领域:教程、网站、博客记录(陆续更新)
- spoj16935 Straight Line Spiral Pattern (Act 3)
- TIME_WAIT状态原理
- “人工智能大脑”跳槽记:吴恩达所理解的智能
- 【AI开发第一步】微软认知服务API应用
- http://blog.csdn.net/huang_xw/article/details/7090173
- USACO|Barn Repair|堆|贪心|动态规划
- 详解wait和waitpid函数