1.C#
3.JAVA
词频统计工程的准备工作和实际完成情况
#include <map>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
void display_map(map<string, int> &wmap);
int main()
{
const char *szInputFileName="Text.txt";
ifstream ifs(szInputFileName);
string szTemp;
map<string, int> wmap;
while (ifs>>szTemp)
wmap[szTemp]++;
display_map(wmap);
system("pause");
return false;
}
void display_map(map<string, int> &wmap)
{
<span style="white-space:pre"> </span>map<string, int>::const_iterator map_it;
<span style="white-space:pre"> </span>for (map_it=wmap.begin(); map_it!=wmap.end();map_it++)
<span style="white-space:pre"> </span>{
<span style="white-space:pre"> </span>cout<<map_it->first<<" : "<<map_it->second<<endl;
<span style="white-space:pre"> </span>}
}
3.JAVA
4.hadoop