#include <iostream>
#include <map>
#include <string>
#include <fstream>
using std::cout;
using std::endl;
using std::map;
using std::string;
int main()
{
map<string, int> mp;
std::ifstream in("d:\\data.txt");
string word;
while (in >> word)
mp[word] = 1 + word[0];
in.close();
typedef map<string, int>::const_iterator CI;
for (CI it = mp.begin(); it != mp.end(); it++)
cout << it->first << " : " << it->second << endl;
return 0;
}
/*
run:
c# : 100
c++ : 100
java : 107
php : 113
python : 113
*/