⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 7-0-0.cpp

📁 Accelerated C++ 课后练习题 本人自己完成、可供参考
💻 CPP
字号:
#include<iostream>
#include<string>

#include<map>
using namespace std;

int main()
{
	string s;
	map<string, int> counters;			//store each word and associated counter

	//read the input ,keeping of each word and how often we see it
	while(cin>>s)
	{
		if(s=="exit")
			break;
		++counters[s];
	}

	//write the words and associated counts
	for(map<string, int>::const_iterator it=counters.begin();
								it!=counters.end();++it)
		cout<<it->first<<"\t"<<it->second<<endl;

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -