Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- using namespace std;
- int main() {
- cout << "Enter the string: ";
- string str;
- getline(cin, str);
- vector <string> vecstr;
- string word;
- stringstream s(str);
- while (s >> word) vecstr.push_back(word);
- int vsize = vecstr.size();
- for (int i = 0; i < vsize; i++)
- cout << vecstr[i] << endl;
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement