:
#include <iostream>
#include <fstream>
#include <string>
#include <tchar.h>
using namespace std;
void main()
{
TCHAR ch;
cout << "Enter some symbol, to know, how many words in file have this symbol at the very beginning: ";
cin >> ch;
wstring word;
int count = 0;
ifstream fin("data.txt");
if (fin.is_open())
{
while (!fin.eof())
{
fin >> word;
if (word[0] == ch)
{
count++;
}
}
fin.close();
}
cout << count;
system("pause");
}