zoukankan
html css js c++ java
c++ 字典排序 并统计字符串个数
#include <vector> #include <string> #include <algorithm> #include <iostream> #include <iterator> #include <map> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { vector<string> vec; vec.push_back("This"); vec.push_back("is"); vec.push_back("a"); vec.push_back("key"); vec.push_back("this"); vec.push_back("key"); vec.push_back("A"); vec.push_back("Thas"); vec.push_back("kEy"); map<string,int> words; vector<string>::iterator it = vec.begin(); for(it; it != vec.end(); ++it) { if(words.find(*it) != words.end() ) { int i = words[*it]; ++i; words[*it] = i; } else { words.insert(map<string,int>::value_type(*it,1)); } } map<string,int>::iterator mapit = words.begin(); for(mapit;mapit != words.end();++mapit) { cout<< mapit->first<<" "<<mapit->second<<endl; } return 0; }
查看全文
相关阅读:
localStorage
node开发 npm install -g express-generator@4
Vue 爬坑之路(一)—— 使用 vue-cli 搭建项目
WebSocket 教程
解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
ThinkPHP5 支付宝 电脑与手机支付扩展库
apache中通过mod_rewrite实现伪静态页面的方法
一个PHP文件搞定微信H5支付
Windows下安装Redis及php的redis拓展教程
GIT 常用命令
原文地址:https://www.cnblogs.com/dyufei/p/2573901.html
最新文章
一个简单的Java文件工具类
SqlServer发布订阅错误收集
Sqlserver数据库发送邮件
SqlServer函数获取指定日期后的第某个工作日
java jar
css
正方形
CSS name
form v
正则
热门文章
viewport
JavaScript原生对象属性和方法详解——Array对象
常用函数
html,body最顶层元素.
move
JSON
clearfix
git
MONGODB 查询
inoic是什么
Copyright © 2011-2022 走看看