unordered_map
来源:互联网 发布:女子支付网络被刑拘 编辑:程序博客网 时间:2024/06/05 01:11
.C++11新特性,不自动排序的map unordered_map
#include "stdafx.h"#include <conio.h>#include <iostream>#include <string>//#include <map>#include <unordered_map>using namespace std;int _tmain(int argc, _TCHAR* argv[]){unordered_map<string, size_t> word_count;string word;while (cin >> word){++word_count[word];}for (unordered_map<string,size_t>::iterator itr = word_count.begin(); itr!=word_count.end();itr++){cout << itr->first <<" occurs "<< itr->second <<((itr->second > 1)?" times":" time") <<endl;}//_getch(); //getch名字不建议使用 //获取字符,键盘输入直接退出getchar(); //获取字符,回车后退出//system("pause"); //单纯等待return 0;}
阅读全文
0 0
- unordered_map
- unordered_map
- unordered_map
- unordered_map
- unordered_map -
- unordered_map
- unordered_map
- unordered_map
- unordered_map
- unordered_map
- std::unordered_map::unordered_map
- 关于unordered_map
- unordered_map详解
- C++ unordered_map
- unordered_map & map
- B00011 unordered_map
- C++ unordered_map
- unordered_map笔记
- 解密浏览器缓存机制
- destoon代码从头捋一遍
- mysql:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost
- Android BLE学习笔记
- Apps using background location services must provide a reason that clarifies the purpose of the use
- unordered_map
- 获取两个日期之间天数
- 自己动手搭建React开发环境之三Webpack
- ImageLoader
- OfflineMap 基于MySQL + Node.js + Leaflet的离线地图展示
- POJ 2081 Recaman's Sequence
- Linux网络文件下载
- Hadoop环境配置二(基于Eclipse)
- 构造n个成对括号