#include <iostream>
#include <fstream>
#include <string>
using std::cout;
using std::endl;
int main()
{
std::ifstream ifs("d:\\data.txt");
char s[80], word[] = "c++";
int counter = 0;
while (!ifs.eof()) {
ifs >> s;
if (!strcmp(s, word)) {
counter++;
}
}
ifs.close();
cout << counter << endl;
return 0;
}
/*
run:
3
*/