fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <sstream>
  5. using namespace std;
  6.  
  7. int main(){
  8. string str = "dsfsfs sdfsf sfdsf dsdf";
  9. stringstream ss(str);
  10. vector< string > arr;
  11. while( ss>>str )
  12. arr.push_back(str);
  13. for( size_t i = 0; i < arr.size(); i++ )
  14. cout<<arr[i]<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
dsfsfs
sdfsf
sfdsf
dsdf