用C++编程序统计从键盘输入的单词个数

2025-05-12 13:10:31
推荐回答(1个)
回答(1):

#include
#include

using namespace std;
int main()
{
string s;
int cnt=0;
while(cin>>s)
cnt++;
cout< return 0;
}
输完按Enter Ctrl+z Enter