This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <dirent.h> | |
#include <sys/stat.h> | |
#include <string> | |
#include <cstring> | |
#include <map> | |
template<typename Key, typename T> | |
void flipMap(const std::map<Key, T> & source, | |
std::multimap<T, Key, std::greater<T>> & result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
На входе и выходе текстовые файлы, указанные параметрами командной строки. | |
Во входном файле произвольные данные, обычно текст. | |
На выход нужно записать отдельные слова из входа и их частоты. | |
Например: | |
$ cat in.txt | |
The time has come, the walrus said, to talk of many things. |