Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- string string_strtok(string str)
- {
- vector <string> tokens;
- stringstream s(str);
- string str2;
- while(getline(s, str2, ' '))
- {
- tokens.push_back(str2);
- }
- for(int i = 0; i < tokens.size(); i++)
- cout << tokens[i] <<endl;
- }
- int main()
- {
- string str;
- getline(cin,str);
- string_strtok(str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement