Advertisement
Shiam7777777

Untitled

May 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  4. #define ll long long
  5. #define ld double
  6. #define llu long long unsigned
  7.  
  8. int main()
  9. {
  10.     fast;
  11.  
  12.     string s;
  13.     getline( cin , s );
  14.  
  15.     stringstream geek( s );
  16.  
  17.     int x;
  18.     vector < int > v;
  19.  
  20.     while( geek >> x )
  21.     {
  22.  
  23.         v.push_back( x );
  24.  
  25.         if( geek.peek() == ' ' )
  26.             geek.ignore();
  27.  
  28.     }
  29.  
  30.     for( int i = 0 ; i < v.size() ; i++ )
  31.         cout<<v[i]<<" ";
  32.     cout<<endl;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement