vector遇到的小疑点

vector遇到的小问题#includeiostream#includevector#includestringusing namespace stdint main(){

vector遇到的小问题
#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
string word;
vector< string > text;
while( cin >> word )
{
text.push_back( word );
}
cout << "words read are:" << endl;

for( vector< string >::iterator it = text.begin(); it != text.end(); ++it )
cout << *it << ' ';

cout <<endl;
return 0;
}

输入要怎么让他停下来,求教了

[解决办法]
ctrl+z
[解决办法]

探讨
请问这是为什么这样呢,能否详细些

[解决办法]
探讨
引用:
while( cin >> word &amp;amp;&amp;amp; word != "0") //输入0 结束

这样不行,我是一个数组元素存一个字符串,不是一个元素存一个字符