fork(1) download
  1. #include <sstream>
  2. #include <iostream>
  3.  
  4. double resultado(std::string valor)
  5. {
  6. std::istringstream iss(valor);
  7. int X, Y;
  8.  
  9. iss >> X >> Y;
  10. return X + Y;
  11. }
  12.  
  13. int main()
  14. {
  15. double z = resultado("1+2");
  16.  
  17. std::cout << z << std::endl;
  18. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
3