#include
#include
#include
#include
using namespace std;
int main()
{
fstream f(“C:\Users\Administrator\Desktop\1.txt”);
vector words;
string line;
while (getline(f, line))//会自动把换行符去掉
{
words.push_back(line);
}
//dictionary.txt在csdn里面可以下载,里面有4万多个单词,相当于一个字典
cout << “共有行数:” << words.size() << endl;
system(“pause”);
return 1;
}