/*
* WordCount.cpp
*读取一个文本,计算出用空格隔开的单词的个数
* cin >> word;
* Created on: 2011-9-15
* Author: 何良骏
*/
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main() {
int wordTotal = 0;
char filePath[40];
cin.getline(filePath,sizeof(filePath));
ifstream in(filePath);
string word;
while(in >> word) {
++wordTotal;
}
cout << "该文件里面共有" << wordTotal << "个单词" << endl;
return 0;
}