vector.cpp 270 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include <iostream> #include <vector> #include <string> using namespace std; int main() { string word; vector<string> v; while(cin) { if(cin>>word) v.push_back(word); } for(unsigned int i=0;i<v.size();i++) cout << v[i]<<" "; cout << endl; }