fork(1) download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. string s("{10}{20}Hello World!");
  8. stringstream iss(s);
  9. string a;
  10. int x, y;
  11. iss.ignore(1, '{');
  12. iss >> x;
  13. iss.ignore(1, '}');
  14. iss.ignore(1, '{');
  15. iss >> y;
  16. iss.ignore(1, '}');
  17. getline(iss, a);
  18. cout << a << endl << x << endl << y << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Hello World!
10
20