fork download
  1. #include <iostream>
  2. #include <limits>
  3. #include <sstream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int main() {
  8. int a;
  9. string b;
  10. string c;
  11. double d;
  12. stringstream openFile("173 / lorem ipsum / \thello world / 13.4");
  13.  
  14. openFile >> a;
  15. openFile.ignore(numeric_limits<streamsize>::max(), '/');
  16. getline(openFile, b, '/');
  17. getline(openFile, c, '/');
  18. openFile >> d;
  19.  
  20. cout << a << endl << b << endl << c << endl << d << endl;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
173
 lorem ipsum 
 	hello world 
13.4