#include<iostream>
#include<string>
using namespace std;
main()
{string word;
while(cin>>word)
cout<<"the word read:"<<word;// 读入未知个数的输入,因为word是string类型,所以当你输入how are you 会根据空格区分单词
int a;
cin>>a;
}
也可以用word【76】数组来进行
转载于:https://www.cnblogs.com/zhanghui0910/archive/2009/02/16/1391709.html