#include
#include <Windows.h>
#include
using namespace std;
int main(void) {
string The_word; //字符
int number = 0; //数量
int Long = 0; //长度
int len = 1; //行
cout << "请输入n个单词:";
while (1) {
if ((cin >> The_word) ==0) { 在 vs中不能通过编译
break;
}
/**
if (getline(cin, The_word) == 0) {
break;
}
len += The_word.length();
**/
++number;
Long += The_word.length();
}
cout << "一共有" << number << "个单词" << endl;
cout << "长度为" << Long << endl;
//cout << "共有" << len << "行" << endl;
system("pause");
return 0;
}