Advertisement
rotti321

stringstream

Nov 23rd, 2021
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     string s;
  7.     getline(cin,s);
  8.     stringstream v(s);
  9.     while(getline(v,s,' '))
  10.     {
  11.         cout<<s<<endl;
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement