//#include <string>
#include <map>
#include <unordered_map>
#include <iostream>
#include <fstream>
#include <cctype>
#include <algorithm>

 int main() {
  std::unordered_map<std::string, int> m1;
  std::string s;

  std::ifstream ifs("MrRobot.txt");
	if(ifs){

		while(!ifs.eof()){
			ifs>>s;
			if(!ifs.fail()){
        transform(s.begin(),s.end(),s.begin(), (int (*)(int))tolower);
        s.erase(remove_if(s.begin(), s.end(),::ispunct),s.end() );
        m1[s]++;
			}
		}
		ifs.close();
	}
for (auto  p : m1) {
  std::cout << p.first<<" - "<< p.second << std::endl;
}

std::cout << "la map avec hack y a : "<< m1["hack"] << std::endl;
return 0;
}
