```
#include<iostream>
#include<fstream>
#include<string>
#include<map>
using namespace std;
int main(int argc, char *argv[])
{
ifstream in("in.txt");
ofstream out("out.txt");
string c;
map<string, int> stringNum;
while (in >> c) {
stringNum[c]++;
}
for (map<string, int>::iterator it = stringNum.begin(); it != stringNum.end(); it++)
{
out << it->first << " : " << it->second << endl;
}
in.close();
return 0;
}
```